+ 2
what's the ((x%10)/5) mean
if the roop has 20 numbers,it will println like this 00000111110000011111, for(i=0;i<20;i++){ system.out.print((x%10)/5); } Why is that? If I want to get three 0 followed by five 1, and then loop, how should i do,like this 000111110001111100011111
2 Réponses
+ 7
x%10 returns the remainder of x divided by 10.
Then, after computing x%10, we divide the value by 5.
0
????