Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- int main (void)
- {
- ifstream ins ("input.txt");
- string S;
- while (! ins.eof())
- getline(ins,S);
- int k=0;
- string::size_type i;
- for (i=0; i<S.size();i++)
- if (S[i]>='0' && S[i]<='9')
- k++;
- cout << k << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment