Main.cc: In function ‘int main()’: Main.cc:2:75: warning: unused variable ‘total’ [-Wunused-variable] int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); int total = a * 0.2 + b * 0.3 + c * 0.5 + 0.5; // 四舍五入 printf("%d\n", total); return 0; } ^~~~~ Main.cc:2:116: error: expected ‘}’ at end of input int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); int total = a * 0.2 + b * 0.3 + c * 0.5 + 0.5; // 四舍五入 printf("%d\n", total); return 0; } ^ Main.cc:2:41: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); int total = a * 0.2 + b * 0.3 + c * 0.5 + 0.5; // 四舍五入 printf("%d\n", total); return 0; } ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~