a53

WriteDigits

a53
Mar 10th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.14 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. string number;
  4. short int digit;
  5.  
  6. int main()
  7. {
  8. cin>>number;
  9. for(int n=0;number[n];++n)
  10. {
  11. digit=number[n]-'0';
  12. if(digit==0)
  13. {
  14. for(int i=1;i<=5;++i)
  15. {
  16. if(i==1||i==5)
  17. for(int j=1;j<=5;++j)
  18. cout<<'@';
  19. else
  20. for(int j=1;j<=5;++j)
  21. if(j==1 || j==5)
  22. cout<<'@';
  23. else
  24. cout<<' ';
  25. cout<<'\n';
  26. }
  27. cout<<'\n';
  28. }
  29. else if(digit==1)
  30. {
  31. for(int i=1;i<=5;++i)
  32. {
  33. if(i==5)
  34. for(int j=1;j<=5;++j)
  35. cout<<'@';
  36. else
  37. for(int j=1;j<=5;++j)
  38. if(j==3||(i==2&&j==2))
  39. cout<<'@';
  40. else
  41. cout<<' ';
  42. cout<<'\n';
  43. }
  44. cout<<'\n';
  45. }
  46. else if(digit==2)
  47. {
  48. for(int i=1; i<=5; i++)
  49. {
  50. if(i==1 || i==5)
  51. for(int j=1;j<5;j++)
  52. cout<<'@';
  53. else
  54. for(int j=1; j<5; j++)
  55. if((i==2&&(j==1||j==4))||(i==3&&j==3)||(i==4&&j==2))
  56. cout<<'@';
  57. else
  58. cout<<' ';
  59. cout<<'\n';
  60. }
  61. cout<<'\n';
  62. }
  63. else if(digit==3)
  64. {
  65. for(int i=1;i<=5;++i)
  66. {
  67. if(i==1||i==3||i==5)
  68. for(int j=1;j<=5;++j)
  69. cout<<'@';
  70. else
  71. for(int j=1;j<=5;++j)
  72. if(j==5)
  73. cout<<'@';
  74. else
  75. cout<<' ';
  76. cout<<'\n';
  77. }
  78. cout<<'\n';
  79. }
  80. else if(digit==4)
  81. {
  82. for(int i=1;i<=5;++i)
  83. {
  84. if(i==3)
  85. for(int j=1;j<=5;++j)
  86. cout<<'@';
  87. else
  88. for(int j=1;j<=5;++j)
  89. if((j==1&&i!=4&&i!=5)||j==5)
  90. cout<<'@';
  91. else
  92. cout<<' ';
  93. cout<<'\n';
  94. }
  95. cout<<'\n';
  96. }
  97. else if(digit==5)
  98. {
  99. for(int i=1;i<=5;++i)
  100. {
  101. if(i==1||i==3||i==5)
  102. for(int j=1;j<=5;++j)
  103. cout<<'@';
  104. else
  105. for(int j=1;j<=5;++j)
  106. if((j==1&&i!=4)||(j==5&&i!=2))
  107. cout<<'@';
  108. else
  109. cout<<' ';
  110. cout<<'\n';
  111. }
  112. cout<<'\n';
  113. }
  114. else if(digit==6)
  115. {
  116. for(int i=1;i<=5;++i)
  117. {
  118. if(i==1||i==3||i==5)
  119. for(int j=1;j<=5;++j)
  120. cout<<'@';
  121. else
  122. for(int j=1;j<=5;++j)
  123. if(j==1||(j==5&&i!=2))
  124. cout<<'@';
  125. else
  126. cout<<' ';
  127. cout<<'\n';
  128. }
  129. cout<<'\n';
  130. }
  131. else if(digit==7)
  132. {
  133. for(int i=1;i<=5;++i)
  134. {
  135. if(i==1)
  136. for(int j=1;j<5;++j)
  137. cout<<'@';
  138. else
  139. for(int j=1;j<=5;++j)
  140. if(j==4||(i==3&&j==3)||(i==3&&j==5))
  141. cout<<'@';
  142. else
  143. cout<<' ';
  144. cout<<'\n';
  145. }
  146. cout<<'\n';
  147. }
  148. else if(digit==8)
  149. {
  150. for(int i=1;i<=5;++i)
  151. {
  152. if(i==1||i==3||i==5)
  153. for(int j=1;j<=5;++j)
  154. cout<<'@';
  155. else
  156. for(int j=1;j<=5;++j)
  157. if(j==1||j==5)
  158. cout<<'@';
  159. else
  160. cout<<' ';
  161. cout<<'\n';
  162. }
  163. cout<<'\n';
  164. }
  165. else if(digit==9)
  166. {
  167. for(int i=1;i<=5;++i)
  168. {
  169. if(i==1||i==3)
  170. for(int j=1;j<=5;++j)
  171. cout<<'@';
  172. else
  173. for(int j=1;j<=5;++j)
  174. if((j==1&&i!=4&&i!=5)||j==5)
  175. cout<<'@';
  176. else
  177. cout<<' ';
  178. cout<<'\n';
  179. }
  180. cout<<'\n';
  181. }
  182. }
  183. return 0;
  184. }
Advertisement
Add Comment
Please, Sign In to add comment