Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- // Bus
- int main()
- {
- int pass, stops;
- scanf("%d %d", &pass, &stops);
- int up, down;
- for (int i = 0; i < stops; i++)
- {
- scanf("%d %d", &down, &up);
- pass = pass - down + up;
- }
- pass = pass + stops % 2 * 2;
- printf("The final number of passengers is : %d\n", pass);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement