201503-1 图像旋转
#include <iostream>using namespace std;int a[1010][1010];int main(){int n,m;cin>>n>>m;for(int i=0;i<n;i++){for(int j=0;j<m;j++){cin>&
·
#include <iostream>
using namespace std;
int a[1010][1010];
int main(){
int n,m;
cin>>n>>m;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
cin>>a[i][j];
}
}
for(int j=m-1;j>=0;j-- ){
for(int i=0;i<n;i++){
cout<<a[i][j]<<" ";
}
cout<<endl;
}
return 0;
}
思考: n:2 m:3
观察 0,2 1 2 0,1, 1,1 0,0 1,0 可得出输出的规律,容易得出答案
(水题)
更多推荐
已为社区贡献3条内容
所有评论(0)