求教ww请问这么写是哪里有问题?
public class HelloWorld {
public static void main(String[] args) {
int sum = 0;
for (int i = 1;i <= 100 && i % 3 != 0;i ++) {
sum = sum + i;
}
System.out.println("1到100之间不能被3整除的数之和为:" + sum);
}
}
public class HelloWorld {
public static void main(String[] args) {
int sum = 0;
for (int i = 1;i <= 100 && i % 3 != 0;i ++) {
sum = sum + i;
}
System.out.println("1到100之间不能被3整除的数之和为:" + sum);
}
}
2019-01-15
举报