按顺序来就行,从小到大一串数
1 import java.util.Scanner; 2 3 public class P1082 4 { 5 public static void main(String args[]) 6 { 7 try (Scanner cin = new Scanner(System.in)) 8 { 9 while (cin.hasNext()) 10 { 11 int n = cin.nextInt(); 12 for (int i = 0; i < n; i++) 13 System.out.print(i + " "); 14 System.out.println(); 15 } 16 } 17 } 18 }
时间: 2024-10-21 22:45:04