結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー trymaiua1017trymaiua1017
提出日時 2016-11-22 17:38:33
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 566 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 20,352 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-05 12:20:34
合計ジャッジ時間 601 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 0 ms
5,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 0 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 0 ms
5,376 KB
testcase_16 AC 0 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[6]’ [-Wformat=]
    6 |   scanf("%s",&a);
      |          ~^  ~~
      |           |  |
      |           |  char (*)[6]
      |           char *
main.c:7:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[6]’ [-Wformat=]
    7 |   scanf("%s",&b);
      |          ~^  ~~
      |           |  |
      |           |  char (*)[6]
      |           char *
main.c:6:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |   scanf("%s",&a);
      |   ^~~~~~~~~~~~~~
main.c:7:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |   scanf("%s",&b);
      |   ^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main(void){
  char a[6],b[6];
  int i,c;
  c = 0;
  scanf("%s",&a);
  scanf("%s",&b);
  for(i = 1;i >= 6;){
    if(a[i] != 1 | a[i] != 2 | a[i] != 3 | a[i] != 4 | a[i] != 5 | a[i] != 6 | a[i] != 7 | 
       a[i] != 8 | a[i] != 9){
      c = 1;
      break;
    }else if(b[i] != 1 | b[i] != 2 | b[i] != 3 | b[i] != 4 | b[i] != 5 | b[i] != 6 | b[i] != 7 | 
       b[i] != 8 | b[i] != 9){
      c = 1;
      break;
    }else{
      i++;
    }
  }
  if(c == 1){
    printf("NG");
  }else{
    printf("OK");
  }
  return 0;
}
      
      
  
  
  
0