package Demo2;
public class doWhile2 {
public static void main(String[] args) {
int i = 0,sum = 0;
do {
if (i%2 == 0)
sum += i;
i++;
//i += 2;
//sum += i;
}while(i <= 100);
System.out.println("偶数和为:"+ sum);
}
}
do-while
最新推荐文章于 2023-07-26 14:58:45 发布