Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Rage_Expenses_Fund_Exercise_1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int countOfLostGames = 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());
- double total = 0;
- int counterBreakHeadset = 0;
- int counterBreakMouse = 0;
- int counterBreakKeyboard = 0;
- int counterBreakDisplay = 0;
- for (int i = 1; i <= countOfLostGames; i++)
- {
- if (i % 2 == 0)
- {
- counterBreakHeadset++;
- }
- if (i % 3 == 0)
- {
- counterBreakMouse++;
- }
- if (i % 2 == 0 && i % 3 == 0)
- {
- counterBreakKeyboard++;
- if (counterBreakKeyboard % 2 == 0)
- {
- counterBreakDisplay++;
- }
- }
- }
- total = counterBreakHeadset * headsetPrice + counterBreakMouse * mousePrice + counterBreakKeyboard * keyboardPrice + counterBreakDisplay * displayPrice;
- Console.WriteLine($"Rage expenses: {total:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement