Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _10._Rage_Expenses
- {
- class Program
- {
- static void Main(string[] args)
- {
- int lostGames = int.Parse(Console.ReadLine());
- decimal headsetPrice = decimal.Parse(Console.ReadLine());
- decimal mousePrice = decimal.Parse(Console.ReadLine());
- decimal keyboardPrice = decimal.Parse(Console.ReadLine());
- decimal displayPrice = decimal.Parse(Console.ReadLine());
- int brokenHeadset = 0;
- int brokenMouse = 0;
- int brokenKeyboard = 0;
- int brokenDisplay = 0;
- for (int i = 1; i <= lostGames; i++)
- {
- if (i % 6 == 0)
- {
- brokenHeadset++;
- brokenMouse++;
- brokenKeyboard++;
- if (brokenKeyboard % 2 == 0)
- {
- brokenDisplay++;
- }
- }
- else if (i % 3 == 0)
- {
- brokenMouse++;
- }
- else if (i % 2 == 0)
- {
- brokenHeadset++;
- }
- }
- decimal totalPrice =
- brokenHeadset * headsetPrice +
- brokenMouse * mousePrice +
- brokenKeyboard * keyboardPrice +
- brokenDisplay * displayPrice;
- Console.WriteLine($"Rage expenses: {totalPrice:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement