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 Arena_Tournament
- {
- class Program
- {
- static void Main(string[] args)
- {
- var points = double.Parse(Console.ReadLine());
- string arena = Console.ReadLine().ToLower();
- string day = Console.ReadLine().ToLower();
- string items = Console.ReadLine().ToLower();
- double itemsCondition = 0;
- double discount = 0.0;
- if (items == "poor")
- {
- itemsCondition = 7000;
- }
- else if (items == "normal")
- {
- itemsCondition = 14000;
- }
- else if (items == "legendary")
- {
- itemsCondition = 21000;
- }
- if (arena == "nagrand")
- {
- if (day == "monday" || day == "wednesday")
- {
- discount = 0.05;
- }
- else
- {
- discount = 0;
- }
- }
- else if (arena == "gurubashi")
- {
- if (day == "tuesday" || day == "thursday")
- {
- discount = 0.10;
- }
- else
- {
- discount = 0;
- }
- }
- else if (arena == "dire maul")
- {
- if (day == "friday" || day == "saturday")
- {
- discount = 0.07;
- }
- else
- {
- discount = 0;
- }
- }
- double priceItems = itemsCondition - (itemsCondition * discount);
- double pricePerItem = priceItems / 5;
- if(priceItems <= points)
- {
- double pointsLeft = points - priceItems;
- Console.WriteLine("Items bought: 5");
- Console.WriteLine("Arena points left: {0}", pointsLeft);
- Console.WriteLine("Success!");
- }
- else
- {
- double itemsBought = 0;
- while (pricePerItem <= points)
- {
- itemsBought++;
- points -= pricePerItem;
- }
- double pointsLeft = points - (itemsBought * pricePerItem);
- Console.WriteLine("Items bought: {0}", itemsBought);
- Console.WriteLine("Arena points left: {0}", points);
- Console.WriteLine("Failure!");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment