Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main()
- {
- int cnt = 0;
- char c1, c2, c3, c4;
- scanf(" %c %c", &c1, &c2);
- while(scanf(" %c %c", &c3, &c4) != EOF)
- {
- if((c1 == c3 && c2 == c4) || (c1 != c3 && c2 != c4))
- cnt++;
- else if((c1 == c3 && c2 != c4) || (c1 != c3 && c2 == c4))
- {
- c1 = c3;
- c2 = c4;
- }
- }
- printf("%d\n", cnt);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement