Skip to content

Instantly share code, notes, and snippets.

@surinoel
Created August 4, 2019 12:23
Show Gist options
  • Save surinoel/ebb51852c5d14cc875a7c95fea98afc0 to your computer and use it in GitHub Desktop.
Save surinoel/ebb51852c5d14cc875a7c95fea98afc0 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
char mat[101][101];
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
cin >> mat[i][j];
}
}
// 왼쪽 아래
for (int i = n + 1; i <= 2 * n; i++) {
for (int j = 1; j <= m; j++) {
mat[i][j] = mat[2 * n - i + 1][j];
}
}
// 오른쪽 그
for (int i = 1; i <= 2 * n; i++) {
for (int j = m + 1; j <= 2 * m; j++) {
mat[i][j] = mat[i][2 * m - j + 1];
}
}
int a, b;
cin >> a >> b;
mat[a][b] = (mat[a][b] == '.') ? '#' : '.';
for (int i = 1; i <= 2 * n; i++) {
for (int j = 1; j <= 2 * m; j++) {
cout << mat[i][j];
}
cout << '\n';
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment