| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 27283 | 张弛 | 数1的个数 | C++ | Accepted | 100 | 0 MS | 244 KB | 198 | 2021-12-11 15:00:39 |
#include<bits/stdc++.h> using namespace std; int n,ans,j; int main(){ cin>>n; for(int i=1;i<=n;i++){ j=i; while(j){ if(j%10==1) ans++; j=j/10; } } cout<<ans; return 0; }