Advertisement
Guest User

Untitled

a guest
Jun 30th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.22 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. namespace Regex_test
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             double money = double.Parse(Console.ReadLine());
  11.             int Students = int.Parse(Console.ReadLine());
  12.             double prizeSabers = double.Parse(Console.ReadLine());
  13.            
  14.             double freeSaber = Math.Ceiling(Students * 1.1);
  15.  
  16.             //while (copyStudents % 6 == 0 && copyStudents > 0)
  17.             //{
  18.             //    copyStudents -= 6;
  19.             //    Count++;
  20.  
  21.             //}
  22.             int Count = (int)(Students/6);
  23.  
  24.  
  25.             double prizeOfRobes = double.Parse(Console.ReadLine());
  26.             double prizeOfBelts = double.Parse(Console.ReadLine());
  27.             double cost = (Students - Count) * prizeOfBelts + Students * prizeOfRobes + (freeSaber * prizeSabers);
  28.  
  29.             //if (money - cost > 0)
  30.             if (money - cost >= 0)
  31.             {
  32.                 Console.WriteLine($"The money is enough - it would cost {cost:F2}lv.");
  33.             }
  34.             else
  35.             {
  36.                 Console.WriteLine($"Ivan Cho will need {(cost - money):F2}lv more.");
  37.             }
  38.  
  39.  
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement