太深了
查看原帖
太深了
948733
ywrow楼主2024/12/24 19:46

我就交了这个代码上去

#include<bits/stdc++.h>
using namespace std;
bool isr(int a){
	return a%4==0&&(a%100!=0||a%400==0);
}
int main(){
	int a,b,ans;
	queue<int>q;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		if(isr(i)){
			q.push(i);
			ans++;
		}
	}
	cout<<ans<<"\n";
	while(!q.empty()){
		cout<<q.front()<<' ';
		q.pop();
	}
}


因为平时开着o2优化,所以这次我就没管他.结果0分,把o2优化关了,AC了 ???

2024/12/24 19:46
加载中...