| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 46447 | 杨中琦 | 数1的个数 | C++ | Accepted | 100 | 0 MS | 248 KB | 201 | 2022-07-13 13:24:00 |
#include<bits/stdc++.h> using namespace std; int n,ans; int main(){ cin>>n; for(int i=1;i<=n;i++){ int j=i; while(j){ if(j%10==1) ans++; j/=10; } } cout<<ans; return 0; }