Created
September 16, 2017 15:00
-
-
Save invatainfo/404572bd01136143d64400d5e4ed14ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
int i, n, j, a[30][30]; | |
cin >> n; | |
for (i = 0; i < n; i++) | |
for (j = 0; j < n; j++) | |
if (i + j == n - 1) | |
a[i][j] = 0; | |
else | |
a[i][j] = n - i; | |
for (i = 0; i < n; i++) { | |
for (j = 0; j < n; j++) | |
cout << a[i][j] << " "; | |
cout << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment