Seal_of_approval

2p25

Dec 18th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <cctype>
  2. #include <cstdio>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6.  
  7. int main(void)
  8. {
  9. freopen("input.txt", "r", stdin);
  10.  
  11. string s;
  12.  
  13. int max = 0;
  14. while (cin >> s) {
  15. cout << s << endl;
  16. int count = 0;
  17. for (int i = 0; i < s.size(); i++)
  18. if (isalpha(s[i]) || ((int) s[i] == -48 || (int) s[i] == -47)) count++;
  19.  
  20. cout << "Current count: " << count << endl;
  21. if (count >= max) max = count;
  22. }
  23. cout << "Max count: " << max << endl;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment