package study01;
publicclass TestWhile {
publicstaticvoid main(String[] args) {
int sum = 0;
int i = 1;
while (i <= 100) {
System.out.println(i);
sum += i;
i++;
}
System.out.println(sum);
}
}
结果等于 5050
posted on
2016-12-04 02:08王月波
阅读(3462)
评论(0)
编辑收藏举报