Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _03.ArenaTournament
- {
- class Program
- {
- static void Main(string[] args)
- {
- double points = double.Parse(Console.ReadLine());
- string areaName = Console.ReadLine().ToLower();
- string dayOfWeek = Console.ReadLine().ToLower();
- string itemCondition = Console.ReadLine().ToLower();
- double discount = 0;
- if (areaName == "nagrand")
- {
- if (dayOfWeek == "monday" || dayOfWeek == "wednesday")
- {
- discount = 5.0 / 100.0;
- }
- }
- else if (areaName == "gurubashi")
- {
- if (dayOfWeek == "thuesday" || dayOfWeek == "thursday")
- {
- discount = 10.0 / 100.0;
- }
- }
- else if (areaName == "dire maul")
- {
- if (dayOfWeek == "friday" || dayOfWeek == "saturday")
- {
- discount = 7.0 / 100.0;
- }
- }
- double priceAllItems = 0;
- if (itemCondition == "poor")
- {
- priceAllItems = 7000;
- }
- else if (itemCondition == "normal")
- {
- priceAllItems = 14000;
- }
- else if (itemCondition == "legendary")
- {
- priceAllItems = 21000;
- }
- priceAllItems -= priceAllItems * discount;
- double priceOneThing = priceAllItems / 5.0;
- int itemsBought = 0;
- while (true)
- {
- if (points - priceOneThing < 0 || itemsBought >= 5)
- {
- break;
- }
- points -= priceOneThing;
- itemsBought++;
- }
- Console.WriteLine("Items bought: " + itemsBought);
- Console.WriteLine("Arena points left: " + points);
- if (itemsBought >= 5)
- {
- Console.WriteLine("Success!");
- }
- else
- {
- Console.WriteLine("Failure!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement