Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int a[25][25], n, m, i, j, x;
  5. int main()
  6. { cin>>n;
  7. for (i=1;i<=n;i++)
  8. for (j=1;j<=n;j++)
  9. if (i<j && i+j<n+1)
  10. a[i][j]=1;
  11. else
  12. if (i>j && i+j>n+1)
  13. a[i][j]=2;
  14. else
  15. if (i!=j && i+j!=n+1)
  16. a[i][j]=3;
  17. for (i=1;i<=n;i++)
  18. {
  19. for (j=1;j<=n;j++)
  20. cout << a[i][j]<<' ';
  21. cout<< endl;
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement