SHARE
TWEET

Untitled

a guest Sep 19th, 2019 77 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[23][23];
  5. int main()
  6. {
  7.     cin>>n;
  8.     for(int i=0; i<=n; i++)
  9.         for(int j=0; j<=n; j++)
  10.         {
  11.             if(i % 2 != 0)
  12.                 a[i][j]=i;
  13.             else
  14.                 a[i][j]=j;
  15.         }
  16.     for(int i=1; i<=n; i++)
  17.        {
  18.  
  19.        for(int j=1; j<=n; j++)
  20.             cout<<a[i][j]<<" ";
  21.             cout<<endl;}
  22.  
  23.  
  24. }
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