fork download
  1. #include <stdio.h>
  2.  
  3. int main(){
  4. char c[3],t;
  5. c[2]=' ';
  6. c[1]=' ';
  7. c[0]=' ';
  8. int counter;
  9. counter=0;
  10. while (1){
  11. t=getchar();
  12. if (t==10)
  13. continue;
  14. if ((int)t<=0)
  15. break;
  16. c[2]=c[1];
  17. c[1]=c[0];
  18. c[0]=t;
  19. if((c[2]==' '|c[2]=='.')&c[1]==c[0]&c[1]!=' '&c[1]!='.')
  20. counter++;
  21. }
  22. printf("\n :: %d ",counter);
  23. return 0;
  24. }
  25.  
  26.  
  27.  
Success #stdin #stdout 0s 2160KB
stdin
e
e
 
a
s
d
a
s
 
e
e
 
e
 
e
e
e
e
e
e

 
 
 
 
e
e
stdout
 :: 4