SHARE
TWEET

Traveling C#

kolioi Jul 15th, 2018 574 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main()
  6.     {
  7.         while (true)
  8.         {
  9.             string destination = Console.ReadLine();
  10.             if (destination == "End")
  11.                 break;
  12.  
  13.             double expences = double.Parse(Console.ReadLine()), savings = 0;
  14.  
  15.             while (savings < expences)
  16.             {
  17.                 double money = double.Parse(Console.ReadLine());
  18.                 savings += money;
  19.             }
  20.  
  21.             Console.WriteLine($"Going to {destination}!");
  22.         }
  23.     }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top