提出 #29463514


ソースコード 拡げる

#include<stdio.h>
int main()
{
  long a,b,c;
  scanf("%ld",&c);
  b=c%10;
  if(c>0){
  a=c/10;
  printf("%ld",a);
  }
  else{ 
    if(b==0)
      a=c/10;
    else{
      a=c/10;
      a=a-1;
  }
    printf("%ld",a);
}
    return 0;
}

提出情報

提出日時
問題 B - Integer Division
ユーザ TCSP
言語 C (GCC 9.2.1)
得点 200
コード長 253 Byte
結果 AC
実行時間 3 ms
メモリ 1732 KiB

コンパイルエラー

./Main.c: In function ‘main’:
./Main.c:5:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
    5 |   scanf("%ld",&c);
      |   ^~~~~~~~~~~~~~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 5
AC × 18
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 01_max_00.txt, 02_min_00.txt, 03_border_00.txt, 03_border_01.txt, 04_near_zero_00.txt, 04_near_zero_01.txt, 04_near_zero_02.txt, 05_small_00.txt, 05_small_01.txt, 06_random_00.txt, 06_random_01.txt, 07_integer_00.txt, 07_integer_01.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 2 ms 1664 KiB
00_sample_01.txt AC 1 ms 1672 KiB
00_sample_02.txt AC 1 ms 1648 KiB
00_sample_03.txt AC 1 ms 1732 KiB
00_sample_04.txt AC 1 ms 1732 KiB
01_max_00.txt AC 1 ms 1640 KiB
02_min_00.txt AC 1 ms 1732 KiB
03_border_00.txt AC 1 ms 1652 KiB
03_border_01.txt AC 1 ms 1652 KiB
04_near_zero_00.txt AC 3 ms 1732 KiB
04_near_zero_01.txt AC 1 ms 1640 KiB
04_near_zero_02.txt AC 1 ms 1652 KiB
05_small_00.txt AC 3 ms 1644 KiB
05_small_01.txt AC 3 ms 1652 KiB
06_random_00.txt AC 1 ms 1668 KiB
06_random_01.txt AC 1 ms 1636 KiB
07_integer_00.txt AC 1 ms 1668 KiB
07_integer_01.txt AC 1 ms 1636 KiB