include <bits/stdc++.h>
using namespace std;
const int maxn=1e4+1;
int mar[maxn];
void tmar(int mar[],const int n,const int m){
int mat[n+1][m+1],mat1[m+1][n+1];
int i,j;
for(i=1;i<=n;i++){
for(j=1;j<=m;j++){
mat[i][j]=mar[(i-1)*m+j];
}
}
for(i=1;i<=m;i++){
for(j=1;j<=n;j++){
mat1[i][j]=mat[j][i];
}
}
i=1;
j=1;
int cnt=1;
while(cnt<=n*m){
mar[cnt]=mat1[i][j];
j++;
cnt++;
if(j==n+1) {
i++;
j=1;
}
}
}
int main() {
int n,m,t;
int a,b,c;
cin>>n>>m>>t;
int i,j;
for(i=1;i<=n*m;i++){
cin>>mar[i];
}
for(j=0;j<t;j++){
cin>>a>>b>>c;
if(a1){
n=b;
m=c;
}
else if(a2){
tmar(mar,n,m);
int tem;
tem=n;
n=m;
m=tem;
}
else{
c++;
printf("%d\n",mar[b*m+c]);
}
}
return 0;
}
标签:02,mar,06,tem,int,cin,2024,const,mat From: https://www.cnblogs.com/likh2718/p/18415122