Advertisement
Prohause

Travelling onw code

Oct 21st, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Test
  4. {
  5. internal class Program
  6. {
  7. private static void Main(string[] args)
  8. {
  9. string input;
  10.  
  11. while ((input = Console.ReadLine()) != "End")
  12. {
  13. string destination = input;
  14. double budget = double.Parse(Console.ReadLine());
  15. double sum = 0;
  16.  
  17. while (sum < budget)
  18. {
  19. sum += double.Parse(Console.ReadLine());
  20. }
  21.  
  22. Console.WriteLine($"Going to {destination}!");
  23. }
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement