Advertisement
Guest User

Untitled

a guest
May 21st, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.19 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _10_Rage_Expenses
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int games = int.Parse(Console.ReadLine());
  10.             double headsetpr = double.Parse(Console.ReadLine());
  11.             double mousepr = double.Parse(Console.ReadLine());
  12.             double keyboardpr = double.Parse(Console.ReadLine());
  13.             double displaypr = double.Parse(Console.ReadLine());
  14.             int headset = 0;
  15.            
  16.             for (int i = 1; i <= games; i+=2)
  17.             {
  18.                 headset = i/2;
  19.             }
  20.             int mouse = 0;
  21.             for (int i = 1; i <= games; i += 3)
  22.             {
  23.                 mouse = i/3;
  24.             }
  25.             int keyboard = 0;
  26.             for (int i = 1; i <= games; i += 6)
  27.             {
  28.                 keyboard = i/6;
  29.             }
  30.             int display = 0;
  31.             for (int i = 1; i <= games; i += 12)
  32.             {
  33.                 display = i/12;
  34.             }
  35.             double price = headset * headsetpr + mouse * mousepr + keyboard * keyboardpr + display * displaypr;
  36.             Console.WriteLine($"Rage expenses: {price:f2} lv.");
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement