Advertisement
Guest User

Untitled

a guest
Oct 20th, 2018
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 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 _06.Travelling
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string destination = Console.ReadLine();           
  14.             while (destination != "End")
  15.             {
  16.                 double minBudget = double.Parse(Console.ReadLine());
  17.                 double sum = 0;            
  18.                 while (sum < minBudget)
  19.                 {
  20.                     double input = double.Parse(Console.ReadLine());
  21.                     sum += input;
  22.                 }
  23.                 Console.WriteLine($"Going to {destination}!");
  24.                 destination = Console.ReadLine();
  25.             }
  26.  
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement