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