Advertisement
K_Y_M_bl_C

B

May 22nd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int w, h, y, x;
  7.     cin >> w >> h;
  8.     char f[h][w], s[h][w], l[4];
  9.     for (y = 0; y < h; ++y) for (x = 0; x < w; ++x) cin >> f[y][x];
  10.     for (y = 0; y < h; ++y) for (x = 0; x < w; ++x) cin >> s[y][x];
  11.     for (y = 0; y < 4; ++y) cin >> l[y];
  12.     for (y = 0; y < h; ++y) {
  13.         for (x = 0; x < w; ++x) cout << l[ (f[y][x]-'0') * 2 + s[y][x]-'0' ];
  14.         cout << endl;
  15.     }
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement