123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- #include <bits/stdc++.h>
- using namespace std;
- char c[10][7][5]={
- '*','*','*','*','*',
- '*','.','.','.','*',
- '*','.','.','.','*',
- '*','.','.','.','*',
- '*','.','.','.','*',
- '*','.','.','.','*',
- '*','*','*','*','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '*','*','*','*','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '*','*','*','*','*',
- '*','.','.','.','.',
- '*','.','.','.','.',
- '*','*','*','*','*',
- '*','*','*','*','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '*','*','*','*','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '*','*','*','*','*',
- '*','.','.','.','*',
- '*','.','.','.','*',
- '*','.','.','.','*',
- '*','*','*','*','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '*','*','*','*','*',
- '*','.','.','.','.',
- '*','.','.','.','.',
- '*','*','*','*','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '*','*','*','*','*',
- '*','*','*','*','*',
- '*','.','.','.','.',
- '*','.','.','.','.',
- '*','*','*','*','*',
- '*','.','.','.','*',
- '*','.','.','.','*',
- '*','*','*','*','*',
- '*','*','*','*','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '*','*','*','*','*',
- '*','.','.','.','*',
- '*','.','.','.','*',
- '*','*','*','*','*',
- '*','.','.','.','*',
- '*','.','.','.','*',
- '*','*','*','*','*',
- '*','*','*','*','*',
- '*','.','.','.','*',
- '*','.','.','.','*',
- '*','*','*','*','*',
- '.','.','.','.','*',
- '.','.','.','.','*',
- '*','*','*','*','*'};
- char s[7][11];
- int book(int a)
- {
- int b;
- if(s[0][a+1]=='.')
- {
- if(s[0][a]=='.')
- b=1;
- else
- b=4;
- }
- else
- {
- if(s[3][a+1]=='.')
- {
- if(s[3][a]=='*')
- b=0;
- else
- b=7;
- }
- else if(s[4][a]=='*'&&s[5][a]=='*')
- {
- if(s[1][a+4]=='*'&&s[2][a+4]=='*'&&s[4][a+4]=='.'&&s[5][a+4]=='.')
- b=2;
- else if(s[1][a+4]=='*'&&s[2][a+4]=='*'&&s[4][a+4]=='*'&&s[5][a+4]=='*')
- b=8;
- else
- b=6;
- }
- else
- {
- if(s[1][a]=='.'&&s[2][a]=='.'&&s[4][a]=='.'&&s[5][a]=='.')
- b=3;
- else if(s[1][a+4]=='.'&&s[2][a+4]=='.'&&s[4][a+4]=='*'&&s[5][a+4]=='*')
- b=5;
- else
- b=9;
- }
- }
- return b;
- }
- int main()
- {
- //freopen("test1.in","r",stdin);
- //freopen("test1.out","w",stdout);
- int a,b,sum;
- int t;
- scanf("%d",&t);
- for(int p=0;p<t;p++)
- {
- for(int i=0;i<7;i++)
- {
- scanf("%s",&s[i]);
- }
- a=book(0);
- b=book(6);
- sum=a+b;
- if(sum<10)
- {
- for(int i=0;i<=6;i++)
- {
- for(int j=0;j<=4;j++)
- {
- printf("%c",c[sum][i][j]);
- }
- printf("\n");
- }
- }
- else
- {
- int n;
- n=sum%10;
- for(int i=0;i<=6;i++)
- {
- for(int j=0;j<=4;j++)
- printf("%c",c[1][i][j]);
- printf(".");
- for(int j=0;j<=4;j++)
- printf("%c",c[n][i][j]);
- printf("\n");
- }
- }
- printf("\n");
- }
- return 0;
- }
|