結果

問題 No.82 市松模様
ユーザー umashika
提出日時 2016-02-25 01:44:43
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 20,736 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 13:38:24
合計ジャッジ時間 611 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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==a[0]){k = 0;}
  else{k = 1;}

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

  return 0;
}





0