public class TestWhile1{
public static void main(String[] args){
/*int num=1; //条件初始化
int result =1;
while(num<=13){ //条件判断
result *= num; //循环体
num +=2; //num++ //迭代
}
System.out.println(result);*/
/*int num = 1;
int result = 0;
do{
result += num;
num += 1;
}while(num<=100); //do while代码至少执行一次,先考试,在判断合格
System.out.println(result);*/
int sum = 0;
for(int i = 1;i<=100;i++){
sum +=i;
}
System.out.println(sum);
}
}