Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
78695 sh25_zhangjiajia 数1的个数 C++ Accepted 0 MS 244 KB 347 2025-12-27 10:21:03

Tests(1/1):


#include <iostream> using namespace std; int main() { int a,b,c,e=0; cin>>a; for(int i=1;i<=a;i=i+1) { b=i; while(b!=0) { c=b%10; b=(b-c)*1.0/10; if(c==1) { e=e+1; } } } cout<<e; return 0; }


Judgement Protocol: