为啥还是零分 测试多次都能通过
查看原帖
为啥还是零分 测试多次都能通过
408589
jifeng85楼主2020/10/20 18:55
#include<iostream>
using namespace std;
int main()
{
	int x , y = 0;
	int arr[1000];
	cin >> x >> y;
	int j = 0;
	for (int i=0;x <= y;x++) 
	{
		if (x % 400 == 0) 
		{
			arr[i] = x;
			i++;
			j++;
		}
		else if (x % 100 != 0 && x % 4 == 0)
		{
			arr[i] = x;
			i++;
			j++;
		}
		else { continue; }
	}
	cout << j << endl;
	for (int q = 0;q < 1000;q++)
	{ if (arr[q]>0)
		cout << arr[q] << " ";
	else { continue; }
	}
}

望大佬们不吝赐教

2020/10/20 18:55
加载中...