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 _10.RageExpenses
- {
- class Program
- {
- static void Main(string[] args)
- {
- int lostGames = Int32.Parse(Console.ReadLine());
- decimal priceHeadset = decimal.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
- decimal priceMouse = decimal.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
- decimal priceKeyboard = decimal.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
- decimal priceDisplay = decimal.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
- int trashedHeadset = 0;
- int trashedMouse = 0;
- int trashedKeyboard = 0;
- int trashedDisplay = 0;
- for (int i = 1; i <= lostGames; i++)
- {
- if (i % 2 == 0)
- trashedHeadset++;
- if (i % 3 == 0)
- trashedMouse++;
- if(i % 2 == 0 & i % 3 == 0)
- {
- trashedKeyboard++;
- if (trashedKeyboard % 2 == 0)
- trashedDisplay++;
- }
- }
- decimal sum = priceHeadset * trashedHeadset + priceMouse * trashedMouse + priceKeyboard * trashedKeyboard + priceDisplay * trashedDisplay;
- Console.WriteLine($"Rage expenses: {sum, 0:N2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement