Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- int n, m, k, c, x,y;
- char s;
- cin >> n >> m >> k;
- int mass[n+1][m+1];
- for(int i=1;i<=n;i++)
- {
- for (int j=1; j<=m;j++){
- cin >> mass[i][j];
- }
- }
- cout << mass[n][m] << endl;
- for(int l=0; l < k; l++){
- cin >> s >> x >> y;
- if(s=='g'){
- cout << mass[x][y] << endl;
- }else if(s=='r'){
- for (int i=1; i<=n;i++){
- c = mass[i][x];
- mass[i][x] = mass[i][y];
- mass[i][y] = c;
- }
- }else{
- for (int j=1; j<=m;j++){
- c = mass[x][j];
- mass[x][j] = mass[y][j];
- mass[y][j] = c;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement