結果
| 問題 |
No.82 市松模様
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-01-01 17:30:29 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 403 bytes |
| コンパイル時間 | 111 ms |
| コンパイル使用メモリ | 20,480 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-13 01:10:22 |
| 合計ジャッジ時間 | 749 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 7 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d %d %s",&W,&H,&C);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#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;
}
}
}
return 0;
}