fork(6) download
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6.  
  7.  
  8. int main()
  9. {
  10. string foo = "aaaaaaa1";
  11.  
  12. int count=0;
  13.  
  14. for (int i=0;i<foo.length();i++)
  15. {
  16. if ( isalpha(foo[i]))
  17. {
  18. count++;
  19. }
  20. }
  21.  
  22. cout<<count;
  23. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
7