Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var city = Console.ReadLine().ToLower();
- var transport = Console.ReadLine().ToLower();
- var bag = Console.ReadLine().ToLower();
- var hrs_left = double.Parse(Console.ReadLine());
- double time = 0;
- double hrs = 0;
- //smetki
- if (city == "sofia")
- {
- if (transport == "car")
- {
- time = 3;
- }
- else if (transport == "train")
- {
- time = 4.5;
- }
- else if (transport == "foot")
- {
- time = 55.5;
- }
- else if (transport == "bus")
- {
- time = 3.7;
- }
- }
- else if (city == "plovdiv")
- {
- if (transport == "car")
- {
- time = 4.8;
- }
- else if (transport == "train")
- {
- time = 7;
- }
- else if (transport == "foot")
- {
- time = 85;
- }
- else if (transport == "bus")
- {
- time = 6.5;
- }
- }
- else if (city == "bansko")
- {
- if (transport == "car")
- {
- time = 2.5;
- }
- else if (transport == "train")
- {
- time = 4;
- }
- else if (transport == "foot")
- {
- time = 43;
- }
- else if (transport == "bus")
- {
- time = 32;
- }
- if (bag == "backpack")
- {
- time = time * 1.03;
- }
- else if (bag == "sack")
- {
- time = time * 1.1;
- }
- else if (bag == "none")
- {
- time = time * 1.08;
- }
- hrs = hrs_left - time;
- Console.WriteLine("hrs" + hrs);
- //izhod
- if (hrs_left > time)
- {
- Console.WriteLine(String.Format("{0:0.0} Hours left until New Year's evening", hrs));
- }
- else {
- Console.WriteLine(String.Format("Oh no. Stoyan is late. New year's evening started {0:0.0} hours ago", Math.Abs(hrs)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement