package com.fqs.test; import java.util.Scanner; public class hello { public static void main(String[] args) { //循环打印1到5 int i=0; while(i<5){ i++; System.out.print(i); } } }
先打印后 计数猜比较好理解
package com.fqs.test; import java.util.Scanner; public class hello { public static void main(String[] args) { //循环打印1到5 int i=1; while(i<=5){ System.out.print(i); i++; } } }
标签:java,int,打印,while,循环,public From: https://www.cnblogs.com/haha1988/p/17452563.html