Advertisement
Dimo1985

Untitled

Jan 23rd, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp18
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int games = int.Parse(Console.ReadLine());
  10.             double headsetPrize = double.Parse(Console.ReadLine());
  11.             double mousePrize = double.Parse(Console.ReadLine());
  12.             double keyboardPrize = double.Parse(Console.ReadLine());
  13.             double displayPrize = double.Parse(Console.ReadLine());
  14.             double rageExp = 0;
  15.             for (int i = 1; i < games+1; i++)
  16.             {
  17.                 if (i % 2 == 0) rageExp += headsetPrize;
  18.                 if (i % 3 == 0) rageExp += mousePrize;
  19.                 if (i % 6 == 0) rageExp += keyboardPrize;
  20.                 if (i % 12 == 0) rageExp += displayPrize;
  21.             }
  22.             Console.WriteLine($"Rage expenses: {rageExp:f2} lv.");
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement