Run ID:110126

提交时间:2025-02-14 23:08:41

#include <iostream> using namespace std; int main(){ int a[4][4],tmp; for(int i=1;i<=3;i++) for(int j=1;j<=3;j++) cin>> a[i][j]; for(int i=1;i<=3;i++) for(int j=1;j<=3;j++) { if(i>j) { tmp = a[i][j]; a[i][j] = a[j][i]; a[j][i] = tmp; } } for(int i=1;i<=3;i++) { for(int j=1;j<=3;j++) cout<< a[i][j]<<" "; cout<< endl; } return 0; } /* Input 1 2 3 4 5 6 7 8 9 Output 1 4 7 2 5 8 3 6 9 */