結果

問題 No.82 市松模様
ユーザー umashika
提出日時 2016-02-25 01:44:37
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 331 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 20,480 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 13:38:23
合計ジャッジ時間 628 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 5 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:12:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |   scanf("%d %d %c",&column,&row,&c);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>

int main()
{
  char c;
  int i,j;
  int row;   //行
  int column;//列
  char a[2]={'W','B'};
  int k;

  scanf("%d %d %c",&column,&row,&c);


  if(c=='W'){k = 0;}
  else{k = 1;}
  for(i=0;i<row;i++){
    for(j=0;j<column;j++){
      printf("%c",a[k%2]);
      k++;
    }
    printf("\n");
  }

  return 0;
}


0