shuffle/shuffle_vanb.java
1
2 import java.io.*;
3 import java.util.*;
4 import java.awt.geom.*;
5
6
7
8
9
10
11 public class shuffle_vanb
12 {
13 public Scanner sc;
14 public PrintStream ps;
15
16
17
18
19
20 public void doit() throws Exception
21 {
22 sc = new Scanner( new File( "shuffle.judge" ) );
23 ps = new PrintStream( new FileOutputStream( "shuffle.solution" ) );
24
25 String cards[] = new String[1000];
26
27 for(;;)
28 {
29 int n = sc.nextInt();
30 if( n==0 ) break;
31
32 for( int i=0; i<n; i++ )
33 {
34 cards[i] = sc.next();
35 }
36
37
38
39
40
41
42
43
44
45
46 int mid = n/2 + n%2;
47
48 for( int i=0; i<mid; i++ )
49 {
50
51 ps.println( cards[i] );
52
53
54 if( mid+i<n ) ps.println( cards[mid+i] );
55 }
56 }
57 }
58
59
60
61
62 public static void main( String[] args ) throws Exception
63 {
64 new shuffle_vanb().doit();
65 }
66 }