Lucian_Adrian

Untitled

Sep 7th, 2021
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. unsigned int n;
  8. int i, j;
  9. char c, d;
  10. cin>>n>>c>>d;
  11. for(i=1;i<=n;i++){
  12. if (i%2==1){for(j=1;j<=n;j++){
  13. if(j%2==1) cout<<c;
  14. else cout<<d;}
  15. }
  16. else if (i%2==0){for(int k=1;k<=n;k++){
  17. if(k%2==1) cout<<d;
  18. else cout<<c;}
  19. }
  20. cout<<endl;}
  21. return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment