C++ :
#include<bits/stdc++.h> using namespace std; int q,a,z,w,s,x,e,d,c,r,f,v,t,g,b,y,h,n,u,j,m,i,k,o,l,p; int main(){ cin>>n; while(n!=0){ s=n%10; n=n/10; if(s==1){ c++; } } cout<<c; return 0; }
By signing up a 津桥OJ universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 津桥OJ universal account