Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace RageExpenses
- {
- class Program
- {
- static void Main(string[] args)
- {
- int lost = int.Parse(Console.ReadLine());
- double headset = double.Parse(Console.ReadLine());
- double mouse = double.Parse(Console.ReadLine());
- double keyboard = double.Parse(Console.ReadLine());
- double display = double.Parse(Console.ReadLine());
- double headsetC = 0;
- double mouseC = 0;
- double keyboardC = 0;
- double displayC = 0;
- for (int i = 1; i <= lost; i++)
- {
- if (i % 2 == 0)
- {
- headsetC++ ;
- }
- if (i % 3 == 0)
- {
- mouseC++;
- }
- if (i % 2 == 0 && i % 3 == 0)
- {
- keyboardC++;
- if (keyboardC % 2 == 0)
- {
- displayC++;
- }
- }
- }
- double expenses = headset * headsetC + mouse * mouseC + keyboard * keyboardC + display * displayC;
- Console.WriteLine($"Rage expenses: {expenses:F2} lv.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement