#include #define GET(x) notend=EOF!=(x=getchar()) #define PUT(x) putchar(x) #define pf(a,b,c,d) {c=b;d=a;} #define NEW 1 #define OLD 0 main(){ int a,b,c,d,notend; GET(a);GET(b); while( notend ){ pf(a,b,c,d); p2(c,OLD); p2(d,OLD); GET(a); GET(b); } p2(a,EOF); } p2(c,opcode) int c,opcode; { static int n,m; static int QS=1; if(opcode==NEW)QS=1; switch(QS){case 1: goto Q1;case 2:goto Q2; case 3:goto Q3;} /*GET(c);*/Q1:; while( opcode!=EOF ){ /*line*/ for( m=1; opcode!=EOF && m<=10; m++ ){ /*group*/ for( n=1; opcode!=EOF && n<=5; n++ ){ PUT(c); /*GET(c)*/QS=2;return(1);Q2:; } PUT(' '); } PUT('\n'); } QS=3;Q3:return(0); }