結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2016-02-25 02:04:54 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 296 bytes |
コンパイル時間 | 123 ms |
コンパイル使用メモリ | 20,736 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 13:38:29 |
合計ジャッジ時間 | 564 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:10:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d %d %s",&column,&row,s); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> int main() { int i,j; int row,column; char s[5]; scanf("%d %d %s",&column,&row,s); if(s[0]=='W'){ s[1]='B'; } else{ s[1]='W'; } for(i=0;i<row;i++){ for(j=0;j<column;j++){ printf("%c",s[(i+j)%2]); } printf("\n"); } return 0; }