提出 #1237001


ソースコード 拡げる

#include <stdio.h>
#include <string.h>
int main(void)
{
  char a[102], b[102];
  int i;
  scanf("%s", a);
  scanf("%s", b);
  if(strlen(a) > strlen(b)){
    printf("GREATER\n");
    return 0;
  }
  if(strlen(b) > strlen(a)){
    printf("LESS\n");
    return 0;
  }

  for(i = 0; a[i] != '\0'; i++){
    if(a[i] + '0' > b[i] + '0'){
      printf("GREATER\n");
      return 0;
    }
    if(a[i] + '0' < b[i] + '0'){
      printf("LESS\n");
      return 0;
    }
  }
  printf("EQUAL\n");
  return 0;
}

提出情報

提出日時
問題 B - Comparison
ユーザ Lionking07
言語 C (GCC 5.4.1)
得点 200
コード長 527 Byte
結果 AC
実行時間 1 ms
メモリ 128 KiB

コンパイルエラー

./Main.c: In function ‘main’:
./Main.c:7:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", a);
   ^
./Main.c:8:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", b);
   ^

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 4
AC × 14
セット名 テストケース
Sample 00-00.txt, 00-01.txt, 00-02.txt, 00-03.txt
All 00-00.txt, 00-01.txt, 00-02.txt, 00-03.txt, 01-00.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt
ケース名 結果 実行時間 メモリ
00-00.txt AC 1 ms 128 KiB
00-01.txt AC 1 ms 128 KiB
00-02.txt AC 1 ms 128 KiB
00-03.txt AC 1 ms 128 KiB
01-00.txt AC 1 ms 128 KiB
01-01.txt AC 1 ms 128 KiB
01-02.txt AC 1 ms 128 KiB
01-03.txt AC 1 ms 128 KiB
01-04.txt AC 1 ms 128 KiB
01-05.txt AC 1 ms 128 KiB
01-06.txt AC 1 ms 128 KiB
01-07.txt AC 1 ms 128 KiB
01-08.txt AC 1 ms 128 KiB
01-09.txt AC 1 ms 128 KiB