Skip to content

Instantly share code, notes, and snippets.

@surinoel
Created July 31, 2019 05:33
Show Gist options
  • Save surinoel/4989828566a5238c93ec7e757f75ab38 to your computer and use it in GitHub Desktop.
Save surinoel/4989828566a5238c93ec7e757f75ab38 to your computer and use it in GitHub Desktop.
#include <map>
#include <string>
#include <iostream>
using namespace std;
char mat[100][100];
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
map<char, char> mp;
mp['.'] = '.';
mp['O'] = 'O';
mp['-'] = '|';
mp['|'] = '-';
mp['/'] = '\\';
mp['\\'] = '/';
mp['^'] = '<';
mp['<'] = 'v';
mp['v'] = '>';
mp['>'] = '^';
int n, m;
cin >> n >> m;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> mat[i][j];
}
}
for (int i = m - 1; i >= 0; i--) {
for (int j = 0; j < n; j++) {
cout << mp[mat[j][i]];
}
cout << '\n';
}
cout << '\n';
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment