请问大佬我这样写哪里不对~
public class HelloWorld {
public static void main(String[] args) {
int sum = 0;
for (int i = 1; i<=100,i%3!=0; sum=sum+i,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; sum=sum+i,i++) {
System.out.println("1到100之间不能被3整除的数之和为:" + sum);
}
}
}
2018-08-14
举报