Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Bus
- {
- class Program
- {
- static void Main(string[] args)
- {
- int broiPassager = int.Parse(Console.ReadLine());
- int broiStops = int.Parse(Console.ReadLine());
- double smetka = 0;
- double counterPutnici = 0;
- double leftPasenger = 0;
- for (int currentStops = 1; currentStops <=broiStops; currentStops++)
- {
- double broiSlizashti = double.Parse(Console.ReadLine());
- double broiKachvat = double.Parse(Console.ReadLine());
- if (currentStops % 2 ==1)
- {
- smetka = broiPassager - broiSlizashti + broiKachvat + 2;
- }
- else if (currentStops % 2 ==0)
- {
- smetka = broiPassager - broiSlizashti - 2 + broiKachvat;
- }
- counterPutnici += smetka;
- }
- // counterPutnici += smetka;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement