Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
76594 sh25_shenpy 展示闰年 C++ Accepted 0 MS 200 KB 376 2025-12-19 15:35:00

Tests(1/1):


#include <cstdio> int l = 0; int list[10010]; bool leap_year(int x) { if(x % 4 == 0 && x % 100 != 0) return true; if(x % 400 == 0) return true; return false; } int main() { int a, b; scanf("%d %d", &a, &b); for(int i = a; i <= b; i++) if(leap_year(i)) list[++l] = i; printf("%d\n", l); for(int i = 1; i <= l; i++) printf("%d ", list[i]); return 0; }


Judgement Protocol: