60昏求助
查看原帖
60昏求助
1471907
Coldstar_Qin楼主2024/10/15 19:46
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main() {
	int x, y, z = 0;
	scanf("%d %d",&x,&y);
	for (int i = x; i < y; i++) {
		if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) {
			z++;
		}
	}
	printf("%d\n", z);
	for (int i = x; i <= y; i++) {
		if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) {
			printf("%d ", i);
		}
	}
	return 0;
}

各位大佬看一下,输出是一样的,哪里有错,2和4wa了

2024/10/15 19:46
加载中...