結果
問題 | No.82 市松模様 |
ユーザー |
|
提出日時 | 2014-12-02 23:29:40 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 231 bytes |
コンパイル時間 | 221 ms |
コンパイル使用メモリ | 22,400 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-11 07:43:15 |
合計ジャッジ時間 | 695 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d %d %c",&W,&H,&C); | ~~~~~^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>const char *s="BW";int main(){int W,H;char 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;}