Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46955 | 老方 | 数位和为偶数的数 | C++ | Accepted | 0 MS | 244 KB | 212 | 2024-05-07 21:12:51 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ int t=i,sum=0; while(t){ sum+=t%10; t/=10; } if(sum%2==0)cout<<i<<' '; } return 0; }