package step4;
public class HelloWorld {
public static void main(String[] args) {
int i = 0;
while(i <= 20){
i++;
if( i%2==0 ){
System.out.println( i + "是偶数");
}
else{
System.out.println(i + "是奇数");
}
if(i==13){
break;
}
}
}
}
2024-01-10 08:52:04
package step4;
public class HelloWorld {
public static void main(String[] args) {
int i = 0;
while(i <= 20){
i++;
if( i%2==0 ){
System.out.println( i + "是偶数");
}
else{
System.out.println(i + "是奇数");
}
if(i==13){
break;
}
}
}
}
下一篇:累加数