I.cpp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. char c[10][7][5]={
  4. '*','*','*','*','*',
  5. '*','.','.','.','*',
  6. '*','.','.','.','*',
  7. '*','.','.','.','*',
  8. '*','.','.','.','*',
  9. '*','.','.','.','*',
  10. '*','*','*','*','*',
  11. '.','.','.','.','*',
  12. '.','.','.','.','*',
  13. '.','.','.','.','*',
  14. '.','.','.','.','*',
  15. '.','.','.','.','*',
  16. '.','.','.','.','*',
  17. '.','.','.','.','*',
  18. '*','*','*','*','*',
  19. '.','.','.','.','*',
  20. '.','.','.','.','*',
  21. '*','*','*','*','*',
  22. '*','.','.','.','.',
  23. '*','.','.','.','.',
  24. '*','*','*','*','*',
  25. '*','*','*','*','*',
  26. '.','.','.','.','*',
  27. '.','.','.','.','*',
  28. '*','*','*','*','*',
  29. '.','.','.','.','*',
  30. '.','.','.','.','*',
  31. '*','*','*','*','*',
  32. '*','.','.','.','*',
  33. '*','.','.','.','*',
  34. '*','.','.','.','*',
  35. '*','*','*','*','*',
  36. '.','.','.','.','*',
  37. '.','.','.','.','*',
  38. '.','.','.','.','*',
  39. '*','*','*','*','*',
  40. '*','.','.','.','.',
  41. '*','.','.','.','.',
  42. '*','*','*','*','*',
  43. '.','.','.','.','*',
  44. '.','.','.','.','*',
  45. '*','*','*','*','*',
  46. '*','*','*','*','*',
  47. '*','.','.','.','.',
  48. '*','.','.','.','.',
  49. '*','*','*','*','*',
  50. '*','.','.','.','*',
  51. '*','.','.','.','*',
  52. '*','*','*','*','*',
  53. '*','*','*','*','*',
  54. '.','.','.','.','*',
  55. '.','.','.','.','*',
  56. '.','.','.','.','*',
  57. '.','.','.','.','*',
  58. '.','.','.','.','*',
  59. '.','.','.','.','*',
  60. '*','*','*','*','*',
  61. '*','.','.','.','*',
  62. '*','.','.','.','*',
  63. '*','*','*','*','*',
  64. '*','.','.','.','*',
  65. '*','.','.','.','*',
  66. '*','*','*','*','*',
  67. '*','*','*','*','*',
  68. '*','.','.','.','*',
  69. '*','.','.','.','*',
  70. '*','*','*','*','*',
  71. '.','.','.','.','*',
  72. '.','.','.','.','*',
  73. '*','*','*','*','*'};
  74. char s[7][11];
  75. int book(int a)
  76. {
  77. int b;
  78. if(s[0][a+1]=='.')
  79. {
  80. if(s[0][a]=='.')
  81. b=1;
  82. else
  83. b=4;
  84. }
  85. else
  86. {
  87. if(s[3][a+1]=='.')
  88. {
  89. if(s[3][a]=='*')
  90. b=0;
  91. else
  92. b=7;
  93. }
  94. else if(s[4][a]=='*'&&s[5][a]=='*')
  95. {
  96. if(s[1][a+4]=='*'&&s[2][a+4]=='*'&&s[4][a+4]=='.'&&s[5][a+4]=='.')
  97. b=2;
  98. else if(s[1][a+4]=='*'&&s[2][a+4]=='*'&&s[4][a+4]=='*'&&s[5][a+4]=='*')
  99. b=8;
  100. else
  101. b=6;
  102. }
  103. else
  104. {
  105. if(s[1][a]=='.'&&s[2][a]=='.'&&s[4][a]=='.'&&s[5][a]=='.')
  106. b=3;
  107. else if(s[1][a+4]=='.'&&s[2][a+4]=='.'&&s[4][a+4]=='*'&&s[5][a+4]=='*')
  108. b=5;
  109. else
  110. b=9;
  111. }
  112. }
  113. return b;
  114. }
  115. int main()
  116. {
  117. //freopen("test1.in","r",stdin);
  118. //freopen("test1.out","w",stdout);
  119. int a,b,sum;
  120. int t;
  121. scanf("%d",&t);
  122. for(int p=0;p<t;p++)
  123. {
  124. for(int i=0;i<7;i++)
  125. {
  126. scanf("%s",&s[i]);
  127. }
  128. a=book(0);
  129. b=book(6);
  130. sum=a+b;
  131. if(sum<10)
  132. {
  133. for(int i=0;i<=6;i++)
  134. {
  135. for(int j=0;j<=4;j++)
  136. {
  137. printf("%c",c[sum][i][j]);
  138. }
  139. printf("\n");
  140. }
  141. }
  142. else
  143. {
  144. int n;
  145. n=sum%10;
  146. for(int i=0;i<=6;i++)
  147. {
  148. for(int j=0;j<=4;j++)
  149. printf("%c",c[1][i][j]);
  150. printf(".");
  151. for(int j=0;j<=4;j++)
  152. printf("%c",c[n][i][j]);
  153. printf("\n");
  154. }
  155. }
  156. printf("\n");
  157. }
  158. return 0;
  159. }