SHARE
TWEET

Untitled

a guest May 22nd, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int n,a[25][25];
  5. int main()
  6. {cin>>n;
  7. for(int i=1;i<=n;i++)
  8. {
  9.     if(i%2==1)
  10.     for(int j=1;j<=n;j++)
  11.         a[i][j]=i;
  12.     else
  13.         for(int j=1;j<=n;j++)
  14.             a[i][j]=j;
  15. }
  16. for(int i=1;i<=n;i++)
  17. {
  18.     for(int j=1;j<=n;j++)
  19.         cout<<a[i][j]<<' ';
  20.         cout<<endl;
  21. }
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top