public class Text1{
public static void main(String[] args){
int sum = 0;
for(int i = 1; i < =100; i++){
sum = sum + i;
}
System.out.println(sum);
/**
1:执行初始化语句 i = 1;
2:判断i <= 100;
3:执行循环体;
4:步进迭代;
5:回到第二布继续判断;
}
public class Text1{
public static void main(String[] args){
int sum = 0;
for(int i = 1; i < =100; i++){
sum = sum + i;
}
System.out.println(sum);
/**
1:执行初始化语句 i = 1;
2:判断i <= 100;
3:执行循环体;
4:步进迭代;
5:回到第二布继续判断;
}