Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
71351 sh25_wangsj 数1的个数 C++ Compile Error 0 MS 0 KB 309 2025-10-25 11:37:40

Tests(0/0):


#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: