这个问题在哪里,结果是1,3 。....
public class HelloWorld { public static void main(String[] args) { int sum = 0; for (int i = 1; i % 3 != 0&&i<=100; 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 % 3 != 0&&i<=100; i++) { { sum = sum + i; } } System.out.println("1到100之间不能被3整除的数之和为:" + sum); } }
2015-12-03
举报