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;
- namespace _10.Rage_Expenses
- {
- class Program
- {
- static void Main(string[] args)
- {
- int lostGamesCount = 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 lostHeadsetCounter = 0;
- int lostMouseCounter = 0;
- double lostKeyboardCounter = 0;
- double lostDisplayCounter = 0;
- for (int i = 1; i <= lostGamesCount; i++)
- {
- if (i % 2 == 0)
- {
- lostHeadsetCounter++;
- }
- if (i % 3 == 0)
- {
- lostMouseCounter++;
- }
- if (i % 2 == 0 && i % 3 == 0)
- {
- lostKeyboardCounter++;
- lostDisplayCounter = Math.Floor(lostKeyboardCounter / 2);
- }
- }
- double RageExpenses = headsetPrice * lostHeadsetCounter +
- mousePrice * lostMouseCounter +
- keyboardPrice * lostKeyboardCounter +
- displayPrice * lostDisplayCounter;
- Console.WriteLine($"Rage expenses: {RageExpenses:f2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment