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;
- using System.Globalization;
- namespace zadacha3
- {
- class Program
- {
- static void Main(string[] args)
- {
- double points = double.Parse(Console.ReadLine());
- string arenaName = Console.ReadLine().ToLower();
- string day = Console.ReadLine().ToLower();
- string itemCondition = Console.ReadLine().ToLower();
- var itemsPrice = 0.0;
- var otstupka = 0.0;
- switch (arenaName)
- {
- case "nagrand":
- {
- if (day == "monday" || day == "wednesday")
- {
- otstupka = 0.05;
- }
- } break;
- case "gurubashi":
- {
- if (day == "tuesday" || day == "thursday")
- {
- otstupka = 0.10;
- }
- } break;
- case "dire maul":
- {
- if (day == "friday" || day == "saturday")
- {
- otstupka = 0.07;
- }
- } break;
- }
- switch (itemCondition)
- {
- case "poor":
- {
- itemsPrice = 7000.00;
- } break;
- case "normal":
- {
- itemsPrice = 14000.00;
- } break;
- case "legendary":
- {
- itemsPrice = 21000.00;
- } break;
- }
- int counter = 0;
- int counter2 = 0;
- var calcItemsTax = itemsPrice - (itemsPrice * otstupka);
- var calcItem = calcItemsTax / 5;
- var calcItem2 = 0.0;
- for (int i = 1; i <= 5; i++)
- {
- if (points >= calcItem)
- {
- calcItem2 = points - calcItem;
- points = points - calcItem;
- counter++;
- counter2 = i;
- //Console.WriteLine(points);
- }
- }
- if (counter2 == 5)
- {
- Console.WriteLine($"Items bought: {counter2}");
- Console.WriteLine($"Arena points left: {points}");
- Console.WriteLine("Success!");
- }
- else if (counter2 < 5)
- {
- Console.WriteLine($"Items bought: {counter2}");
- Console.WriteLine($"Arena points left: {points}");
- Console.WriteLine("Failure!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement