Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46478 | yuzhengxun | 数位和为偶数的数 | C++ | Accepted | 0 MS | 244 KB | 269 | 2024-05-04 09:25:35 |
#include<bits/stdc++.h> using namespace std; bool panduan(int n){ int s=0; while(n){ s+=n%10; n/=10; } if(s%2==0) return 1; else return 0; } int main() { int n; cin>>n; for(int i=1;i<=n;i++){ if(panduan(i)) cout<<i<<" "; } return 0; }