Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46694 | sunhuifeng | 数位和为偶数的数 | C++ | Compile Error | 0 MS | 0 KB | 256 | 2024-05-05 09:19:09 |
#include<iostream> using namespace std; bool pd(int i){ int ans=0; while(n){ ans+=i%10; n/=10; } if(ans%2==0) return 1; else return 0; }int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ if(pd(i)) cout<<i<<" "; } return 0; }