結果

問題 No.82 市松模様
ユーザー 313makoto0313makoto0
提出日時 2015-01-01 17:33:10
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 419 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 23,840 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-03 20:20:31
合計ジャッジ時間 794 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>

int main()
{
  int W,H,bw;
  int i,j;
  char C;

  scanf("%d %d %s",&W,&H,&C);

  if (C=='B') {
    bw=0;
  } else {
    bw=1;
  }

  for (i=0;i<H;i++) {
    for (j=0;j<W;j++) {
      if (bw==0) {
	printf("B");
	bw=1;
      } else {
	printf("W");
	bw=0;
      }
    }
    printf("\n");
    if (W%2==0) {
      if (bw==0) {
	bw=1;
      } else {
	bw=0;
      }
    }
  }
  printf("\n");
  return 0;
}
0