結果

問題 No.82 市松模様
ユーザー a2011404
提出日時 2017-03-15 15:59:01
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 238 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 20,608 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-03 23:59:34
合計ジャッジ時間 509 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d %d %c",&w,&h,&c);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>


int main(void){
	int i,j,w,h;
	char c;

	scanf("%d %d %c",&w,&h,&c);

	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			if((i+j)%2==0)	printf("%c",c);
			else		printf("%c",(c=='B'?'W':'B'));
		}
	printf("\n");
	}
	return 0;
}
0