Mã chấm Tài khoản Bài tập Ngôn ngữ lập trình Trạng thái Thời gian Bộ nhớ Kích thước Thời gian nộp
14258 Lê Lâm Anh Vũ Tính giá trị hàm f(x) C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 234 2022-12-29 21:27:29

Lỗi biên dịch:

Main.c: In function ‘f’:
Main.c:5:11: warning: format ‘%ld’ expects argument of type ‘long int *’, but argument 2 has type ‘long long int *’ [-Wformat=]
  scanf("%ld%ld%ld",&a,&b,&c);
         ~~^        ~~
         %lld
Main.c:5:14: warning: format ‘%ld’ expects argument of type ‘long int *’, but argument 3 has type ‘long long int *’ [-Wformat=]
  scanf("%ld%ld%ld",&a,&b,&c);
            ~~^        ~~
            %lld
Main.c:5:17: warning: format ‘%ld’ expects argument of type ‘long int *’, but argument 4 has type ‘long long int *’ [-Wformat=]
  scanf("%ld%ld%ld",&a,&b,&c);
               ~~^        ~~
               %lld
Main.c:6:5: error: expected expression before ‘)’ token
  if()
     ^
Main.c: In function ‘main’:
Main.c:12:11: warning: format ‘%ld’ expects argument of type ‘long int *’, but argument 2 has type ‘long long int *’ [-Wformat=]
  scanf("%ld",&x);
         ~~^  ~~
         %lld
Main.c:13:12: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘long long int’ [-Wformat=]
  printf("%ld",f(x));
          ~~^  ~~~~
          %lld
Main.c: In function ‘f’:
Main.c:5:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%ld%ld%ld",&a,&b,&c);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.c:9:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
Main.c: In function ‘main’:
Main.c:12:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%ld",&x);
  ^~~~~~~~~~~~~~~