/ 21班 /

记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:6:10: error: expected primary-expression before '>' token
    6 |     cin>>>n;
      |          ^
foo.cc:7:22: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
    7 |         cout<<(n%4==0&&n%100!=0||n%400==0)?"YES":"NO";
      |                ~~~~~~^~~~~~~~~~
foo.cc:7:44: warning: second operand of conditional expression has no effect [-Wunused-value]
    7 |         cout<<(n%4==0&&n%100!=0||n%400==0)?"YES":"NO";
      |                                            ^~~~~
foo.cc:7:50: warning: third operand of conditional expression has no effect [-Wunused-value]
    7 |         cout<<(n%4==0&&n%100!=0||n%400==0)?"YES":"NO";
      |                                                  ^~~~
[Hydro](https://hydro.ac)提供评测服务

代码

#include<bits/stdc++.h>
using namespace std;
int n;
int main()
{
    cin>>>n;
	cout<<(n%4==0&&n%100!=0||n%400==0)?"YES":"NO";
}

信息

递交者
类型
递交
题目
P1008 判断闰年
题目数据
下载
语言
C++
递交时间
2023-08-28 12:59:34
评测时间
2023-08-28 12:59:34
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes