| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 43031 | Hyma | 1的个数 | C++ | Accepted | 0 MS | 244 KB | 217 | 2024-03-05 21:27:28 |
#include<bits/stdc++.h> using namespace std; int main() { int n,cnt=1;; cin>>n; for(int i=10;i<=n;i++){ int m=i; while(m){ if(m%10==1) cnt++; m/=10; } } cout<<cnt; return 0; }