//计算数字1-100的和
public class Text01 {
public static void main(String[] args) {
int i = 1;
int j = 0;
while (i <= 100) {
j = j + i;
i++;
}
System.out.println(j);
}
}
while实现1-100的和
最新推荐文章于 2024-05-16 10:23:10 发布
//计算数字1-100的和
public class Text01 {
public static void main(String[] args) {
int i = 1;
int j = 0;
while (i <= 100) {
j = j + i;
i++;
}
System.out.println(j);
}
}