Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main() {
  5. short int caw_caw = 0,
  6. amount = 0;
  7.  
  8. char blink[11];
  9.  
  10. while (caw_caw < 3) {
  11. scanf("%10[^\n]", blink);
  12. fflush(stdin);
  13.  
  14. if (!strcmp(blink, "caw caw")) {
  15. printf("%hd\n", amount);
  16. amount = 0;
  17. caw_caw++;
  18. } else {
  19. if (blink[0] == '*') amount += 4;
  20. if (blink[1] == '*') amount += 2;
  21. if (blink[2] == '*') amount += 1;
  22. }
  23. }
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement