public static void main(String[] args){
//for循环求出1-100之间的偶数和
for(int i = 0; i <=100;i++){
int sum = 0;
if(i%2==0){
sum+=i;
}
}
//while循环求出1-100之间所有的偶数和
int i = 100;
int sum = 0;
while(i>=0){
if(i%2==0){
sum+=i;
i--;
}
}
}
标签:String,int,偶数,循环,100,求出
来源: https://www.cnblogs.com/ailhy/p/16409337.html