记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:7:3: error: 'cout' was not declared in this scope
    7 |   cout<<"请输入一个四则运算式: ";
      |   ^~~~
foo.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
    1 | #include <stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;
foo.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin>>a>>m>>b;
      |   ^~~
foo.cc:8:3: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
foo.cc:11:29: error: 'endl' was not declared in this scope
   11 |         cout<<"非四则运算"<<endl; }
      |                             ^~~~
foo.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; did you forget to '#include <ostream>'?
    1 | #include <stdio.h>
  +++ |+#include <ostream>
    2 | using namespace std;
foo.cc:14:28: error: 'endl' was not declared in this scope
   14 |     cout<<"除式的分母为0"<<endl; }
      |                            ^~~~
foo.cc:14:28: note: 'std::endl' is defined in header '<ostream>'; did you forget to '#include <ostream>'?
foo.cc:18:30: error: 'endl' was not declared in this scope
   18 |       cout<<a<<m<<b<<"="<<f<<endl;break;
      |                              ^~~~
foo.cc:18:30: note: 'std::endl' is defined in header '<ostream>'; did you forget to '#include <ostream>'?
foo.cc:12:3: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
   12 |   else
      |   ^~~~
foo.cc:26:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
   26 |     return 0;
      |     ^~~~~~
foo.cc: At global scope:
foo.cc:28:5: error: redefinition of 'int main()'
   28 | int main()
      |     ^~~~
foo.cc:3:5: note: 'int main()' previously defined here
    3 | int main()
      |     ^~~~
foo.cc: In function 'int main()':
foo.cc:29:2: error: expected '}' at end of input
   29 | {
      | ~^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
3-5 计算器
比赛
2023年新生赛(第一场)
语言
C++
递交时间
2023-08-15 13:03:41
评测时间
2023-08-15 13:03:41
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes