标签:sys 没有 class 布尔 ati 自身 print bsp while
使用while循环输出1-10
int i=1;
while(i<=10)
{
System.out.println(i);
i++;
}
do{
循环体;
}while(布尔表达式);
public class ForTest06
{
//除它自身和1以外没有其他除数。
public static void main(String[] agrs){
int i=1;
while(i <=10){
System.out.println(i);
i++;
}
int j=10;
while(j >1){
System.out.println(j--);
}
int x=1;
do{
x++;
System.out.println(x);
}while(x<=5);
}
}
标签:sys 没有 class 布尔 ati 自身 print bsp while
原文地址:https://www.cnblogs.com/god1/p/11986426.html