Advertisement
asiffff

Counting crow

Dec 22nd, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int i=0,k=0;
  5. char ch[10];
  6. for(;k!=3;)
  7. {
  8. gets(ch);
  9. if(ch[0] == '-' && ch[1] == '-' && ch[2] == '*')
  10. {
  11. i+=1;
  12. }
  13. else if(ch[2] == '-' && ch[1] == '-' && ch[0] == '*')
  14. {
  15. i+=4;
  16. }
  17. else
  18. {
  19. if(ch[0] == 'c' && ch[1] == 'a' && ch[2] == 'w' && ch[3] == ' ' && ch[4] == 'c' && ch[5] == 'a' && ch[6] == 'w')
  20. {
  21. printf("%d\n",i);
  22. i=0;
  23.  
  24. }
  25. }
  26.  
  27. k++;
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement