| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 | 
|---|---|---|---|---|---|---|---|---|
| 135368 | 王晨逸 | 06买鸡腿 | C++ | Compile Error | 0 MS | 0 KB | 286 | 2025-11-03 17:07:45 | 
#include<iostream> usingnamespacestd; intmain() { intb = 7; // 小A手中的金额 inta = 1; // 单价 // 计算总鸡腿数量 intn = b / a; // 基础购买数量 intbonus = (n / 3); // 优惠赠送数量 cout << n + bonus; // 输出总鸡腿数量 }
Main.cc:2:1: error: 'usingnamespacestd' does not name a type
 usingnamespacestd;
 ^
Main.cc:4:9: error: ISO C++ forbids declaration of 'intmain' with no type [-fpermissive]
 intmain() {
         ^
Main.cc: In function 'int intmain()':
Main.cc:5:5: error: 'intb' was not declared in this scope
     intb = 7; // 小A手中的金额
     ^
Main.cc:6:5: error: 'inta' was not declared in this scope
     inta = 1; // 单价
     ^
Main.cc:8:5: error: 'intn' was not declared in this scope
     intn = b / a; // 基础购买数量
     ^
Main.cc:8:12: error: 'b' was not declared in this scope
     intn = b / a; // 基础购买数量
            ^
Main.cc:8:16: error: 'a' was not declared in this scope
     intn = b / a; // 基础购买数量
                ^
Main.cc:9:5: error: 'intbonus' was not declared in this scope
     intbonus = (n / 3); // 优惠赠送数量
     ^
Main.cc:9:17: error: 'n' was not declared in this scope
     intbonus = (n / 3); // 优惠赠送数量
                 ^
Main.cc:10:5: error: 'cout' was not declared in this scope
     cout << n + bonus; // 输出总鸡腿数量
     ^
Main.cc:10:5: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^
Main.cc:10:17: error: 'bonus' was not declared in this scope
     cout << n + bonus; // 输出总鸡腿数量
                 ^
Main.cc:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^