Advertisement
fbinnzhivko

01.00 Nacepin

Apr 21st, 2016
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         decimal PriceUS = decimal.Parse(Console.ReadLine())/(decimal)0.58;
  7.         decimal boxWeightUS = decimal.Parse(Console.ReadLine());
  8.         decimal PriceUK = decimal.Parse(Console.ReadLine())/(decimal)0.41;
  9.         decimal boxWeightUK = decimal.Parse(Console.ReadLine());
  10.         decimal PriceChina = decimal.Parse(Console.ReadLine()) * (decimal)0.27;
  11.         decimal boxWeightChina = decimal.Parse(Console.ReadLine());
  12.  
  13.         decimal totalUS = PriceUS/boxWeightUS;
  14.         decimal totalUK = PriceUK / boxWeightUK;
  15.         decimal totalChina = PriceChina / boxWeightChina;
  16.        
  17.         decimal maxx = Math.Max(totalUS, Math.Max(totalUK, totalChina));
  18.         decimal min = Math.Min(totalUS, Math.Min(totalUK, totalChina));
  19.  
  20.         string current = null;
  21.  
  22.         if (min== totalUS)
  23.         {
  24.             Console.WriteLine("US store. {0:f2} lv/kg", min);
  25.         }
  26.         else if (min == totalUK)
  27.         {
  28.             Console.WriteLine("UK store. {0:f2} lv/kg", min);
  29.         }
  30.         else
  31.         {
  32.             Console.WriteLine("Chinese store. {0:f2} lv/kg", min);
  33.         }
  34.         Console.WriteLine("Difference {0:f2} lv/kg",maxx-min);
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement