fork download
  1. #include <cstdio>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8. char text[199];
  9. int i=0,a=0;
  10.  
  11.  
  12. gets(text);
  13.  
  14. while (text[i]!='\0')
  15. {
  16.  
  17.  
  18. if (text[i]=='a')
  19. {
  20.  
  21. a++;
  22. }
  23.  
  24. i++;
  25. }
  26.  
  27. cout<<a;
  28. }
Success #stdin #stdout 0s 2900KB
stdin
Ein paar Worte, ein paar davon mit 'a'.
stdout
6