結果
問題 |
No.82 市松模様
|
ユーザー |
![]() |
提出日時 | 2019-08-08 16:57:46 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 1,728 bytes |
コンパイル時間 | 298 ms |
コンパイル使用メモリ | 29,056 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 20:01:06 |
合計ジャッジ時間 | 795 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { int width,height; char color; scanf("%d %d %c",&width,&height,&color); if(color=='B') { for(int i=0;i<height;i++) { for(int j=0;j<width;j++) { if(i%2==0) { if(j%2==0) { printf("B"); } else { printf("W"); } } else if(i%2!=0) { if(j%2==0) { printf("W"); } else { printf("B"); } } } printf("\n"); } } else { for(int i=0;i<height;i++) { for(int j=0;j<width;j++) { if(i%2==0) { if(j%2==0) { printf("W"); } else { printf("B"); } } else if(i%2!=0) { if(j%2==0) { printf("B"); } else { printf("W"); } } } printf("\n"); } } }