---------------------------------------------------------
AC代码:
1 import java.util.Scanner; 2 3 public class Main { 4 5 public static void main(String[] args) { 6 7 Scanner sc=new Scanner(System.in); 8 9 int times=sc.nextInt(); 10 while(times-->0){ 11 int n=sc.nextInt(); 12 StringBuilder sb=new StringBuilder(n*3); 13 for(int i=1;i<=n;i+=2) sb.append(i).append(" "); 14 System.out.println(sb); 15 sb=new StringBuilder(n*3); 16 for(int i=2;i<=n;i+=2) sb.append(i).append(" "); 17 System.out.println(sb); 18 } 19 20 } 21 22 }