AC80%,求条,在线等
查看原帖
AC80%,求条,在线等
1044403
王逸辰楼主2024/6/19 19:10
#include <bits/stdc++.h>
using namespace std;
char a[1001][1001];
int main(){
	int n,m,q;
	cin>>n>>m>>q;
	for(int i=1; i<=n; i++)
		for(int j=1; j<=m; j++)
			cin>>a[i][j];
	int op,x,y;
	while(q--){
		cin>>op>>x>>y;
		if(op==1)
				swap(a[x],a[y]);
		else if(op==2)
			for(int i=1; i<=m; i++)
				swap(a[i][x],a[i][y]);
		else
			cout<<a[x][y]<<endl;
	}
	for(int i=1; i<=n; i++){
		for(int j=1; j<=m; j++)
			cout<<a[i][j];
		cout<<endl;
	}
	return 0;
}
2024/6/19 19:10
加载中...