Seal_of_approval

2p25(4)

Dec 7th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5. int main (void)
  6. {
  7. ifstream ins ("input.txt");
  8. string S;
  9. while (! ins.eof())
  10. getline(ins,S);
  11. int k=0;
  12. string::size_type i;
  13. for (i=0; i<S.size();i++)
  14. if (S[i]>='0' && S[i]<='9')
  15. k++;
  16. cout << k << endl;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment