Advertisement
Guest User

neshto si

a guest
Feb 23rd, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Bus
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int broiPassager = int.Parse(Console.ReadLine());
  14. int broiStops = int.Parse(Console.ReadLine());
  15.  
  16.  
  17.  
  18. double smetka = 0;
  19. double counterPutnici = 0;
  20. double leftPasenger = 0;
  21.  
  22.  
  23. for (int currentStops = 1; currentStops <=broiStops; currentStops++)
  24. {
  25. double broiSlizashti = double.Parse(Console.ReadLine());
  26. double broiKachvat = double.Parse(Console.ReadLine());
  27.  
  28. if (currentStops % 2 ==1)
  29. {
  30. smetka = broiPassager - broiSlizashti + broiKachvat + 2;
  31.  
  32.  
  33. }
  34. else if (currentStops % 2 ==0)
  35. {
  36. smetka = broiPassager - broiSlizashti - 2 + broiKachvat;
  37.  
  38. }
  39. counterPutnici += smetka;
  40.  
  41. }
  42. // counterPutnici += smetka;
  43.  
  44.  
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement