标签:
---------------------------------------------------------
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 }
题目来源: http://acm.nyist.net/JudgeOnline/problem.php?pid=11
标签:
原文地址:http://www.cnblogs.com/cc11001100/p/5791684.html