結果

問題 No.82 市松模様
ユーザー mits58
提出日時 2016-07-02 14:42:13
言語 Java
(openjdk 23)
結果
AC  
実行時間 188 ms / 5,000 ms
コード長 389 bytes
コンパイル時間 2,182 ms
コンパイル使用メモリ 74,364 KB
実行使用メモリ 42,036 KB
最終ジャッジ日時 2024-10-12 00:47:33
合計ジャッジ時間 4,013 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			int w=sc.nextInt();
			int h=sc.nextInt();
			char c1=(sc.next()).charAt(0);
			char c2= c1=='W' ? 'B' : 'W';
			for(int i=0;i<h;i++){
				for(int j=0;j<w;j++) System.out.print((i+j)%2==0 ? c1 : c2);
				System.out.println();
			}
		}
	}
}
0