记录详情

Compile Error

foo.cc: In function ‘int main()’:
foo.cc:6:5: error: ‘cin’ was not declared in this scope
    6 |     cin >> n;
      |     ^~~
foo.cc:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; this is probably fixable by adding ‘#include <iostream>’
  +++ |+#include <iostream>
    1 | using namespace std;
foo.cc:15:9: error: ‘cout’ was not declared in this scope
   15 |         cout << i + 1 ;
      |         ^~~~
foo.cc:15:9: note: ‘std::cout’ is defined in header ‘<iostream>’; this is probably fixable by adding ‘#include <iostream>’
foo.cc:50:5: error: ‘cout’ was not declared in this scope
   50 |     cout << total_num << "/" << total_den << endl;
      |     ^~~~
foo.cc:50:5: note: ‘std::cout’ is defined in header ‘<iostream>’; this is probably fixable by adding ‘#include <iostream>’
foo.cc:50:46: error: ‘endl’ was not declared in this scope
   50 |     cout << total_num << "/" << total_den << endl;
      |                                              ^~~~
foo.cc:1:1: note: ‘std::endl’ is defined in header ‘<ostream>’; this is probably fixable by adding ‘#include <ostream>’
  +++ |+#include <ostream>
    1 | using namespace std;

信息

递交者
类型
递交
比赛
南师大2025年新生赛(第一场)
语言
C++
递交时间
2025-08-16 23:16:03
评测时间
2025-08-23 22:09:47
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes