矩阵翻转 题解:直接打印
P1134
发布于2025年1月27日 18:03
阅读数 80
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
while(cin>>n){
int a[n][n];
for(int i=0;i<n;i++){
for(int j=0;j<n;j++)cin>>a[i][j];
}
for(int i=n-1;i>=0;i--){
for(int j=0;j<n;j++){
cout<<a[i][j]<<' ';
}cout<<endl;
}
}
}
不需要反转
登录后发布评论
暂无评论,来抢沙发