Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- public class Program
- {
- public static void Main()
- {
- 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 headsetCounter =0;
- int mouseCounter =0;
- int keyboardCounter =0;
- int displayCounter =0;
- for (int i=1; i<=lostGames; i++)
- {
- if (i%2==0)
- {
- headsetCounter++;
- }
- if (i%3==0)
- {
- mouseCounter++;
- }
- if (i%6==0)
- {
- keyboardCounter++;
- }
- if (i%12==0)
- {
- displayCounter++;
- }
- }
- decimal totalCost = (headsetPrice*headsetCounter) + (mousePrice*mouseCounter) + (keyboardPrice*keyboardCounter) + (displayPrice*displayCounter);
- Console.WriteLine("Rage expenses: {0:f2} lv.",totalCost);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement