/ 科创班 /

记录详情

Accepted

/in/foo.c: In function 'main':
/in/foo.c:7:20: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     if (n % 4 == 0 && n % 100 != 0 || n % 400 == 0)
         ~~~~~~~~~~~^~~~~~~~~~~~~~~
# 状态 耗时 内存占用
#1 Accepted 2ms 256.0 KiB
#2 Accepted 2ms 256.0 KiB
#3 Accepted 2ms 256.0 KiB
#4 Accepted 2ms 256.0 KiB
#5 Accepted 2ms 256.0 KiB
#6 Accepted 2ms 256.0 KiB
#7 Accepted 2ms 256.0 KiB
#8 Accepted 2ms 256.0 KiB
#9 Accepted 2ms 256.0 KiB

代码

#include <stdio.h>

int main()
{
    int n;
    scanf("%d", &n);
    if (n % 4 == 0 && n % 100 != 0 || n % 400 == 0)
        printf("yes");
    else
        printf("no");
    return 0;
}

信息

递交者
类型
递交
题目
闰年判断
题目数据
下载
语言
C
递交时间
2018-10-17 21:48:24
评测时间
2018-10-17 21:48:24
评测机
分数
100
总耗时
21ms
峰值内存
256.0 KiB