Compile Error

foo.cc:2:7: error: expected nested-name-specifier before ‘anemspace’
    2 | using anemspace std;
      |       ^~~~~~~~~
foo.cc: In function ‘bool leap(int)’:
foo.cc:6:18: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
    6 |         if(y%4==0&&y%100!=0||y%400==0)return true;
      |            ~~~~~~^~~~~~~~~~
foo.cc: In function ‘int main()’:
foo.cc:27:9: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’?
   27 |         cin>>y>>m>>d;
      |         ^~~
      |         std::cin
In file included from stdc++.h:146:
/nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/iostream:62:18: note: ‘std::cin’ declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
foo.cc:41:9: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’?
   41 |         cout<<y<<" "<<m<<" "<<d;
      |         ^~~~
      |         std::cout
/nix/gcc-14.2.1.20250322/include/c++/14.2.1.20250322/iostream:63:18: note: ‘std::cout’ declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~

信息

递交者
类型
递交
题目
P2691 一万天以后的日期(函数)
语言
C++
递交时间
2025-07-20 09:02:09
评测时间
2025-07-20 09:02:09
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes