Start: Jun, 26, 2019 08:30:00
2019年度暑期短学期第一天
End: Jun, 26, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: A
Result: Accepted
Time: 6ms
Memory: 1092kB
Author: 2018212212054
In contest: 1273

#include<stdio.h>
int main(){
	int t,n,m,k,i,j,a,b;
	int A[101][101];
	scanf("%d",&t);
	while(t--){
		scanf("%d %d %d",&n,&m,&k);
		for(i=1;i<=n;++i){
			for(j=1;j<=m;++j){
				scanf("%d",&b);
				A[i][j]=b;
			}
		}
	a=k%4;
	if(a==0){
		for(i=1;i<=n;++i){
			for(j=1;j<=m;++j){
				printf("%d ",A[i][j]);
				
			}
			printf("\n");
		}
		printf("\n");
	}
	else if(a==1){
		for(i=1;i<=m;++i){
			for(j=n;j>0;--j){
				printf("%d ",A[j][i]);
				
			}
			printf("\n");
		}
		printf("\n");
	}
	else if(a==2){
		for(i=n;i>0;--i){
			for(j=m;j>0;--j){
				printf("%d ",A[i][j]);
				
			}
			printf("\n");
		}
		printf("\n");
	}
	else if(a==3){
		for(i=m;i>0;--i){
			for(j=1;j<=n;++j){
				printf("%d ",A[j][i]);
	
			}
			printf("\n");
		}
		printf("\n");
	}


	}
	return 0;
}