Java 代码
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
for (int i = 0; i <= 100; i ++)
{
int n = cin.nextInt();
if (n == 0)
break;
for (int j = 1; j <= n ; j ++)
System.out.print(j + " ");
System.out.print("\n");
}
}
}