水题。
1 #include <cstdio> 2 #include <cstring> 3 #include <cstdlib> 4 5 #define MAXN 11 6 #define LEFT 1 7 #define RIGHT 2 8 #define BOTH 3 9 10 char lcd[10][MAXN][2*MAXN+3+1][MAXN+2+1]; 11 int rr[MAXN]; 12 int cc[MAXN]; 13 14 void addR(int x, int i, int j) { 15 int k; 16 17 for (k=1; k<cc[i]-1; ++k) 18 lcd[x][i][j][k] = '-'; 19 } 20 21 void addC(int x, int i,int j, int v) { 22 if (v & LEFT) 23 lcd[x][i][j][0] = '|'; 24 if (v & RIGHT) 25 lcd[x][i][j][cc[i]-1] = '|'; 26 } 27 28 void init() { 29 int i, j, k; 30 int n; 31 32 for (i=1; i<=10; ++i) { 33 rr[i] = 2*i+3; 34 cc[i] = i+2; 35 } 36 37 memset(lcd, ' ', sizeof(lcd)); 38 39 for (k=0; k<10; ++k) { 40 for (i=1; i<=10; ++i) { 41 for (j=0; j<rr[i]; ++j) { 42 lcd[k][i][j][cc[i]] = '