1 solutions
-
0
不可抄袭,仅供参考!!! #include<bits/stdc++.h> using namespace std; bool Run(int x){ if(x % 4 == 0 && x % 100 != 0 || x % 400 == 0){ return true; } return false; } int main(){ int x,y,cnt=0,a[1000]; cin>>x>>y; for(int i=x;i<=y;i++){ if(Run(i)){ cnt++; a[cnt]=i; } } cout<<cnt<<endl; for(int i=1;i<=cnt;i++){ cout<<a[i]<<" "; } }
Information
- ID
- 1966
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 8
- Tags
- (None)
- # Submissions
- 15
- Accepted
- 7
- Uploaded By