Stan0033

Untitled

Apr 16th, 2021
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. using System;
  2.  
  3. namespace travelling
  4. {
  5. class Program
  6. {
  7. static void Main()
  8. {
  9. string Destrination = Console.ReadLine();
  10. int Budget_Minimum = int.Parse(Console.ReadLine());
  11. //--------------------------------------
  12. //--------------------------------------
  13. int Saved_Money = 0;
  14. // France Portugal Spain Egypt
  15. int Destinations_Count = 0;
  16. //--------------------------------------
  17. //--------------------------------------
  18.  
  19.  
  20. while (true)
  21. {
  22. string input = Console.ReadLine();
  23. int paycheck = Convert.ToInt32(input);
  24. Saved_Money += paycheck;
  25. if (paycheck == Budget_Minimum)
  26. {
  27. Console.WriteLine($"Going to {Destrination}!");
  28. Destinations_Count++;
  29. if (Destinations_Count == 4)
  30. {
  31. Console.WriteLine("End"); break;
  32. }
  33. else
  34. {
  35. Destrination = Console.ReadLine();
  36. Budget_Minimum = int.Parse(Console.ReadLine());
  37. }
  38.  
  39. }
  40. }
  41.  
  42. }
  43. }
  44. }
  45.  
Advertisement
Add Comment
Please, Sign In to add comment