結果

問題 No.82 市松模様
コンテスト
ユーザー umashika
提出日時 2016-02-25 02:04:54
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 296 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 148 ms
コンパイル使用メモリ 29,508 KB
最終ジャッジ日時 2026-02-23 20:46:22
ジャッジサーバーID
(参考情報)
judge1 / 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);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#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;
}
0