Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int lostGames = int.Parse(Console.ReadLine());
- double headsetPrice = double.Parse(Console.ReadLine());
- double mousePrice = double.Parse(Console.ReadLine());
- double keyboardPrice = double.Parse(Console.ReadLine());
- double displayPrice = double.Parse(Console.ReadLine());
- int countBreakHeadset = 0;
- int countBreakMouse = 0;
- int countBreakKeyboard = 0;
- int countBreakDisplay = 0;
- for (int i = 1; i <= lostGames; i++)
- {
- if (i % 2 == 0)
- {
- countBreakHeadset++;
- }
- if (i % 3 == 0)
- {
- countBreakMouse++;
- }
- if (i % 6 == 0)
- {
- countBreakKeyboard++;
- }
- if (i % 12 == 0)
- {
- countBreakDisplay++;
- }
- }
- double expenses = headsetPrice * countBreakHeadset + mousePrice * countBreakMouse + keyboardPrice * countBreakKeyboard + displayPrice * countBreakDisplay;
- Console.WriteLine($"Rage expenses: {expenses:f2} lv.");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement