Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int n;
- char c, d;
- scanf(" %d", &n);
- scanf(" %c", &c);
- scanf(" %c", &d);
- for(int i = 1; i <= n; i++)
- {
- if(i % 2 == 1)
- {
- for(int j = 1; j <= n/2; j++)
- {
- printf("%c%c", c, d);
- }
- printf("%c", c);
- printf("\n");
- }
- else{
- for(int j = 1; j <= n/2; j++)
- {
- printf("%c%c", d, c);
- }
- printf("%c", d);
- printf("\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement