結果

問題 No.82 市松模様
ユーザー cielciel
提出日時 2014-12-02 23:28:47
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 221 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 23,040 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-11 07:42:57
合計ジャッジ時間 656 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
5,248 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 0 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 1 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 0 ms
5,376 KB
testcase_08 AC 0 ms
5,376 KB
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:23: warning: format ‘%c’ expects argument of type ‘char*’, but argument 4 has type ‘int*’ [-Wformat=]
    5 |         scanf("%d %d %c",&W,&H,&C);
      |                      ~^        ~~
      |                       |        |
      |                       char*    int*
      |                      %d
main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%d %d %c",&W,&H,&C);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
const char *s="BW";
int main(){
	int W,H,C;
	scanf("%d %d %c",&W,&H,&C);
	C=C==W;
	int y,x;
	for(y=0;y<H;y++){
		for(x=0;x<W;x++){
			putchar(s[(y+x+C)%2]);
		}
		puts("");
	}
	return 0;
}
0