Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int part1;
- int part2;
- int as, ae, bs, be;
- while (scanf( "%d-%d,%d-%d", &as, &ae, &bs, &be ) == 4) {
- part1 += ((bs - as) * (be - ae) <= 0);
- part2 += ((be - as) * (bs - ae) <= 0);
- }
- printf( "Part 1: %d\n", part1 );
- printf( "Part 2: %d\n", part2 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement