tanasaradu

Untitled

Nov 23rd, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int a[1005][1005],n;
  4. int main()
  5. {
  6. cin>>n;
  7. for(int i=1;i<=n;i++)
  8. for(int j=1;j<=n;j++)
  9. if(i==j)
  10. a[i][j]=1;
  11. else if(j>i)
  12. a[i][j]=2;
  13. else a[i][j]=3;
  14. for(int i=1;i<=n;i++)
  15. {
  16. for(int j=1;j<=n;j++)
  17. cout<<a[i][j]<<" ";
  18. cout<<"\n";
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment