Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class BaiIvanAdventures
- {
- static void Main()
- {
- int dayOfWeek = int.Parse(Console.ReadLine());
- decimal availableMoney = decimal.Parse(Console.ReadLine());
- decimal desiredAmountOfAlcohol = decimal.Parse(Console.ReadLine());
- decimal boughtAlcohol = 0;
- string status = " ";
- switch (dayOfWeek)
- {
- case 0: boughtAlcohol = availableMoney / 25m;
- break;
- case 1: boughtAlcohol = availableMoney / 21m;
- break;
- case 2: boughtAlcohol = availableMoney / 14m;
- break;
- case 3: boughtAlcohol = availableMoney / 17m;
- break;
- case 4: boughtAlcohol = availableMoney / 45m;
- break;
- case 5: boughtAlcohol = availableMoney / 59m;
- break;
- case 6: boughtAlcohol = availableMoney / 42m;
- break;
- }
- if (boughtAlcohol>1.5m)
- {
- status = "very drunk";
- Console.WriteLine("");
- }
- else if (boughtAlcohol >= 1.0m)
- {
- status = "drunk";
- }
- else
- {
- status = "sober";
- }
- if (desiredAmountOfAlcohol<boughtAlcohol)
- {
- Console.WriteLine("Bai Ivan is {0} and very happy and he shared {1:F2} l. of alcohol with his friends",status,boughtAlcohol-desiredAmountOfAlcohol);
- }
- else if(desiredAmountOfAlcohol==boughtAlcohol)
- {
- Console.WriteLine("Bai Ivan is {0} and happy. He is as drunk as he wanted",status);
- }
- else
- {
- Console.WriteLine("Bai Ivan is {0} and quite sad. He wanted to drink another {1:F2} l. of alcohol",status,desiredAmountOfAlcohol-boughtAlcohol);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment