結果

問題 No.82 市松模様
ユーザー hanorver
提出日時 2015-09-02 21:43:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 352 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 53,980 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-18 21:39:55
合計ジャッジ時間 847 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>

int main() {
	int w, h;
	char color;

	std::cin >> w >> h >> color;

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			std::cout << color;
			if (color == 'B')color = 'W';
			else color = 'B';
		}
		std::cout << std::endl;
		if (w % 2 == 0) {
			if (color == 'B')color = 'W';
			else color = 'B';
		}
	}
	return 0;
}
0