这个样子为什么不行
class ABC {
public static void main(String[] args) {
int sum = 0;
int num = 1;
for (;num % 3 != 0&&num <= 100 ; num ++ ) {
sum = sum + num;
}
System.out.println(sum);
}
}
class ABC {
public static void main(String[] args) {
int sum = 0;
int num = 1;
for (;num % 3 != 0&&num <= 100 ; num ++ ) {
sum = sum + num;
}
System.out.println(sum);
}
}
2018-10-28
举报