fork(8) download
  1. import java.util.Scanner;
  2. import java.io.*;
  3.  
  4. public class Main {
  5. static Scanner input = new Scanner(System.in);
  6. public static void przesun() {
  7.  
  8. int i=0, z=0, s=0;
  9. int tab[] = new int[102];
  10. int tab2[] = new int[102];
  11.  
  12. for (i=0; i<1; i++)
  13. {
  14.  
  15. tab[0] = input.nextInt();
  16. for (z=1; z<=(int)tab[0]; z++)
  17. {
  18. tab[z] = input.nextInt();
  19. }
  20. }
  21. s=z;
  22. for (i=0; i<= z-1; i++)
  23. {
  24. tab2[s] = tab[i];
  25. s--;
  26. }
  27. for (i=1; i< z; i++) System.out.print(tab2[i]+ " ");
  28. System.out.printf("\n");
  29.  
  30. }
  31.  
  32.  
  33. public static void main(String args[]){
  34.  
  35.  
  36. //BufferedReader klaw = new BufferedReader(new InputStreamReader(System.in));
  37.  
  38. int liczbaTestow =0, counter;
  39.  
  40. liczbaTestow = input.nextInt();
  41.  
  42. for (counter = 0; counter < liczbaTestow; counter++)
  43. przesun();
  44.  
  45.  
  46.  
  47. /* int i=0, j=0, liczbaElementow=0, liczbaTestow=0;
  48.  
  49.  
  50.   liczbaTestow = input.nextInt();
  51.   int tabliczkaCzekolady[][] = new int[liczbaTestow][103];
  52.  
  53.  
  54.   for (i=0; i < liczbaTestow; i++){
  55.   liczbaElementow = input.nextInt();
  56.   tabliczkaCzekolady[i][102] = liczbaElementow;
  57.   for(j = 0; j < liczbaElementow; j++){
  58.  
  59.   tabliczkaCzekolady[i][j] = input.nextInt();
  60.   }
  61.   }
  62.   */
  63.  
  64. /*int przesun()
  65.   {
  66.   int i, z, s, tab[102]={0}, tab2[102]={0};
  67.   for (i=0; i<1; i++)
  68.   {
  69.  
  70.   scanf("%d",&tab[0]);
  71.   for (z=1; z<=(int)tab[0]; z++)
  72.   {
  73.   scanf("%d",&tab[z]);
  74.   }
  75.   }
  76.   s=z;
  77.   for (i=0; i<= z-1; i++)
  78.   {
  79.   tab2[s] = tab[i];
  80.   s--;
  81.   }
  82.   for (i=1; i< z; i++) printf("%d ",tab2[i]);
  83.   printf("\n");
  84.   return 0;
  85.   }
  86.  
  87.   int main()
  88.   {
  89.   int l,n;
  90.   scanf("%d",&l);
  91.   for (n=1;n<=l;n++) przesun();
  92.   }
  93.   */
  94.  
  95. }
  96. }
  97.  
Success #stdin #stdout 0.07s 213760KB
stdin
2
7 1 2 3 4 5 6 7 
3 3 2 11
stdout
7 6 5 4 3 2 1 
11 2 3