package com.gao.循环结构;
public class d4 {
public static void main(String[] args) {
int i = 0;
int sum = 0;
do{
sum = sum + i;
i++;
}while (i<=100);
System.out.println(sum);
}
}
5050
进程已结束,退出代码为 0
=================================================
package com.gao.循环结构;
public class d5 {
public static void main(String[] args) {
int i=0;
while (i<0){
System.out.println(i);
i++;
}
System.out.println("===================");
do{
System.out.println(i);
i++;
}while (i<0);
}
}
===================
0
进程已结束,退出代码为 0