Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cmath>
- #include <math.h>
- using namespace std;
- int n;
- int a[100];
- int main() {
- cin >> n;
- for(int i = 1; i <= n*n; i++){
- cin >> a[i];
- }
- for(int i = 1; i <= n; i++){
- for(int j = 1; j <= n; j++){
- cout << " ---";
- }
- cout<<endl;
- for(int j = 1; j <= n; j++){
- cout << "| " << a[(i-1)*n+j] << " ";
- }
- cout << "|";
- cout << endl;
- }
- for(int j = 1; j <= n; j++){
- cout << " ---";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement