package step2;
public class HelloWorld {
public static void main(String[] args) {
int i=1,sum=0;
while(i<=100){
sum +=i;
i++;
}
System.out.println("1到100相加的结果为"+sum);
}
}
package step2;
public class HelloWorld {
public static void main(String[] args) {
int i=1,sum=0;
while(i<=100){
sum +=i;
i++;
}
System.out.println("1到100相加的结果为"+sum);
}
}