1 #include<string> 2 #include<iostream> 3 using namespace std; 4 5 int main() 6 { 7 string str="1hj1jk11jnk111jk1"; 8 int num=0; 9 //cin>>str; 10 for(unsigned int i=0;i<str.size();i++) 11 { 12 if(str.at(i)=='1') 13 num++; 14 } 15 cout<<num<<endl; 16 return 0; 17 }