Advertisement
Dizzy3113

Untitled

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