//计算1-1000之间所有偶数的和
public class Text02 {
public static void main(String[] args) {
int i = 1;
int j = 0;
while (i <= 1000) {
if (i % 2 == 0) {
j = j + i;
}
i++;
}
System.out.println(j);
}
}
//计算1-1000之间所有偶数的和
public class Text02 {
public static void main(String[] args) {
int i = 1;
int j = 0;
while (i <= 1000) {
if (i % 2 == 0) {
j = j + i;
}
i++;
}
System.out.println(j);
}
}