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
268328 Nguyễn Minh Hiển Ministop HUTECH C/C++ Lỗi biên dịch (CE) 0 MS 0 KB 598 2023-11-18 20:06:01

Lỗi biên dịch:

Main.cc: In function ‘int main()’:
Main.cc:17:11: warning: left operand of comma operator has no effect [-Wunused-value]
     if (0 <= A,B <= 100 && 1 <= X,Y <= 100);
         ~~^~~~
Main.cc:17:25: warning: right operand of comma operator has no effect [-Wunused-value]
     if (0 <= A,B <= 100 && 1 <= X,Y <= 100);
                ~~~~~~~~~^~~~~~~~~
Main.cc:17:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (0 <= A,B <= 100 && 1 <= X,Y <= 100);
     ^~
Main.cc:18:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
     {
     ^
Main.cc:19:15: warning: unused variable ‘tongtien’ [-Wunused-variable]
         float tongtien = A * X + B * Y;
               ^~~~~~~~
Main.cc:21:71: error: ‘tongtien’ was not declared in this scope
     printf("tong so tien can mang theo de mua het tat ca la: %.2f\n", tongtien);
                                                                       ^~~~~~~~
Main.cc:10:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &A);
     ~~~~~^~~~~~~~~~
Main.cc:12:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &B);
     ~~~~~^~~~~~~~~~
Main.cc:14:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%f", &X);
     ~~~~~^~~~~~~~~~
Main.cc:16:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%f", &Y);
     ~~~~~^~~~~~~~~~