| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 27519 | 安一宸 | 数1的个数 | C++ | Accepted | 100 | 0 MS | 252 KB | 218 | 2021-12-12 13:00:37 |
#include<bits/stdc++.h> using namespace std; int c,i,n,t; int main(){ cin>>n; for(i=1;i<=n;i++){ t=i; while(t!=0){ c+=(t%10==1)?1:0; t/=10; } } cout<<c; return 0; }