Advertisement
Cosmin3105

Cifre

Nov 3rd, 2019
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.01 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. ifstream f("date.in");
  7.  
  8. int main()
  9. {
  10.     int n[100][100];
  11.     for(int i = 0; i < 12; i++)
  12.         for(int j = 0; j < 6; j++)
  13.             f >> n[i][j];
  14.  
  15.     char m[100][100];
  16.     int nr;
  17.     cin >> nr;
  18.     int aux = nr;
  19.     nr = 0;
  20.     while(aux){
  21.         nr = nr*10+aux%10;
  22.         aux /= 10;
  23.     }
  24.  
  25.     int c = 0;
  26.     int k = 0;
  27.     int a;
  28.  
  29.     while(nr){
  30.         a = nr%10;
  31.         for(int i = (a-1)*6; i < 6+(a-1)*6; i++){
  32.             for(int j = 0; j < 6; j++)
  33.                 m[k][j+c*6] = n[i][j];
  34.             k++;
  35.         }
  36.         k = 0;
  37.         c++;
  38.         nr /=10;
  39.     }
  40.  
  41.  
  42.     for(int i = 0; i < 6; i++)
  43.         puts(m[i]);
  44.  
  45.     return 0;
  46. }
  47.  
  48.  
  49. //date.in
  50. /*
  51. 32 32 32 178 178 32
  52. 32 32 178 32 178 32
  53. 32 178 32 32 178 32
  54. 32 32 32 32 178 32
  55. 32 32 32 32 178 32
  56. 32 32 32 32 178 32
  57. 32 32 178 178 178 32
  58. 32 178 32 32 32 178
  59. 32 178 32 32 32 178
  60. 32 32 32 178 178 32
  61. 32 32 178 32 32 32
  62. 32 178 178 178 178 178
  63. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement