#include main(){ int W,H; char c; scanf("%d %d %c",&W,&H,&c); char color[] = "BW"; int bw = c=='B'?0:1;//bならば0 printf("bw = %d\nc = %c\n",bw,c);// for(int i = 0;i < H;i++){ for(int j = 0;j < W;j++){ printf("%c",color[bw]); bw = !bw; } bw = !bw;//反転 printf("\n"); } }