Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
536 B
2
Indexable
Never
#include<iostream>
#include<math.h>
#define max 200
using namespace std;

int main(){
	int t;cin>>t;
	while(t--){
		int n;cin>>n;
		int a[max][max];
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				cin>>a[i][j];
			}
		}
		for(int j=1;j<=n;j++) cout<<a[1][j]<<" ";cout<<endl;   // in dong dau
		for(int i=2;i<n;i++){
			cout<<a[i][1]<<" ";
			for(int j=2;j<n;j++){					// in phan giua
				cout<<" "<<" ";
			}
			cout<<a[i][n]<<endl;
		}
		for(int j=1;j<=n;j++) cout<<a[n][j]<<" "; 			// in dong cuoi
	}
}