Tip: use the % operator judgment multiple of 7
Int a=1;
int sum=0;
Do {
Sum=sum + 0;
System. The out. Println (sum);
+;
7==0} while (a % & amp; & a<=50);
}
Please you really don't know where have problem? Thank you for your
CodePudding user response:
A % 7==0 & amp; & a<=50, this is only cycle is 7 digits, must only output 1 0 ended,To try this
Int a=1;
int sum=0;
Do {
If (a % 7==0) {
Sum=sum + 0;
System. The out. Println (sum);
}
+;
} while (a<=50);
}