Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int n,i,j,a[100][100],k;
- cin>>n;
- for (i=0;i<n;i++)
- {
- k=i+1;
- for (j=n-1;j>=0;j--)
- {
- a[i][j]=k;
- if (k>1)
- k--;
- }
- }
- for (i=0;i<n;i++) {
- for (j=0;j<n;j++)
- cout<<a[i][j]<<' ';
- cout<<endl;
- }
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement