Compile Error

foo.cc: In function ‘void init()’:
foo.cc:21:1: error: ‘cin’ was not declared in this scope
   21 | cin>>n>>m;
      | ^~~
foo.cc:5:1: note: ‘std::cin’ is defined in header ‘<iostream>’; this is probably fixable by adding ‘#include <iostream>’
    4 | #include <queue>
  +++ |+#include <iostream>
    5 | using namespace std;
foo.cc: In function ‘void SPFA()’:
foo.cc:61:1: error: ‘cout’ was not declared in this scope
   61 | cout<<"The patient will be dead."<<endl;
      | ^~~~
foo.cc:61:1: note: ‘std::cout’ is defined in header ‘<iostream>’; this is probably fixable by adding ‘#include <iostream>’
foo.cc:61:36: error: ‘endl’ was not declared in this scope
   61 | cout<<"The patient will be dead."<<endl;
      |                                    ^~~~
foo.cc:5:1: note: ‘std::endl’ is defined in header ‘<ostream>’; this is probably fixable by adding ‘#include <ostream>’
    4 | #include <queue>
  +++ |+#include <ostream>
    5 | using namespace std;
foo.cc:63:1: error: ‘cout’ was not declared in this scope
   63 | cout<<d[0]<<endl;
      | ^~~~
foo.cc:63:1: note: ‘std::cout’ is defined in header ‘<iostream>’; this is probably fixable by adding ‘#include <iostream>’
foo.cc:63:13: error: ‘endl’ was not declared in this scope
   63 | cout<<d[0]<<endl;
      |             ^~~~
foo.cc:63:13: note: ‘std::endl’ is defined in header ‘<ostream>’; this is probably fixable by adding ‘#include <ostream>’

信息

递交者
类型
递交
题目
P1157 毒药?解药?
语言
C++
递交时间
2025-07-21 14:34:14
评测时间
2025-07-21 14:34:14
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes