记录详情

Compile Error

foo.cc:2:7: error: expected nested-name-specifier before 'namaspace'
    2 | using namaspace std;
      |       ^~~~~~~~~
foo.cc: In function 'int main()':
foo.cc:18:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   18 |         cin>>n>>k;
      |         ^~~
      |         std::cin
In file included from foo.cc:1:
/nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;           /// Linked to standard input
      |                  ^~~
foo.cc:23:26: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   23 |                 int mid=l+r>>1;
      |                         ~^~
foo.cc:27:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 |         cout<<l<<endl;
      |         ^~~~
      |         std::cout
In file included from foo.cc:1:
/nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
foo.cc:27:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   27 |         cout<<l<<endl;
      |                  ^~~~
      |                  std::endl
In file included from /nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/iostream:39,
                 from foo.cc:1:
/nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/ostream:684:5: note: 'std::endl' declared here
  684 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1464 5-2 Medicine
语言
C++
递交时间
2023-07-10 23:58:59
评测时间
2023-07-10 23:58:59
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes