Advertisement
barbos01

pb7sil

Apr 4th, 2021
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int n;
  7.     char c, d;
  8.     scanf(" %d", &n);
  9.     scanf(" %c", &c);
  10.     scanf(" %c", &d);
  11.     for(int i = 1; i <= n; i++)
  12.     {
  13.         if(i % 2 == 1)
  14.         {
  15.             for(int j = 1; j <= n/2; j++)
  16.             {
  17.                 printf("%c%c", c, d);
  18.             }
  19.             printf("%c", c);
  20.             printf("\n");
  21.  
  22.         }
  23.         else{
  24.             for(int j = 1; j <= n/2; j++)
  25.             {
  26.                 printf("%c%c", d, c);
  27.             }
  28.             printf("%c", d);
  29.             printf("\n");
  30.         }
  31.     }
  32.     return 0;
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement