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: 5ms
Memory: 1132kB
Author: 2018212212289
In contest: 1273

#include <stdio.h>
#include <math.h>
int T,n,m,k;
int a[101][101];
void swap(int *x,int *y){
	int temp;
	temp=*x;
	*x=*y;
	*y=temp;
}
void xuan(){
	int b[101][101];
	swap(&n,&m);
		for(int p=0;p<n;++p){
			for(int q=0;q<m;++q){
				b[p][q]=a[m-1-q][p];
			}
		}	
	for(int p=0;p<n;++p){
			for(int q=0;q<m;++q){
				a[p][q]=b[p][q];
			}
		}	
}
int main(void){
	scanf("%d",&T);
	for(int i=0;i<T;++i){
		scanf("%d%d%d",&n,&m,&k);
		for(int p=0;p<n;++p){
			for(int q=0;q<m;++q){
				scanf("%d",&a[p][q]);
			}
		}	
		k%=4;
		while(k){
		xuan();
		k--;
	}
	for(int p=0;p<n;++p){
			for(int q=0;q<m;++q){
				printf("%d ",a[p][q]);
			}
			printf("\n");
		}
		printf("\n");	
	}
	return 0;
}