CCF认证 201503-1:图像旋转(C++)

在这里插入图片描述

#include<iostream>
#include<algorithm>
const int N=1000;
using namespace std;
int a[N][N],b[N][N];
int main()
{
	int n,m,i,j;
	cin>>n>>m;
	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			cin>>a[i][j]; 
			b[m-j-1][i]=a[i][j];
		}
	}
	for(i=0;i<m;i++){
		for(j=0;j<n;j++){
			cout<<b[i][j]<<" ";
		}
		cout<<endl;
	}
	return 0;
}

发布了61 篇原创文章 · 获赞 9 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_44652687/article/details/104715917