文章

30

粉丝

0

获赞

16

访问

613

头像
矩阵翻转 题解:
P1134 西安交通大学机试题
发布于2026年1月28日 20:25
阅读数 16

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	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++){
			if(j < n-1)
			     cout << a[i][j] << " ";
			else
				 cout << a[i][j] << endl;
		}
	}	
	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发