Advertisement
Guest User

Untitled

a guest
Apr 19th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _01Nacepin
  8. {
  9. class Nacepin
  10. {
  11. static void Main(string[] args)
  12. {
  13. double priceUs = double.Parse(Console.ReadLine());
  14. double weightUs = double.Parse(Console.ReadLine());
  15. double priceUk = double.Parse(Console.ReadLine());
  16. double weightUk = double.Parse(Console.ReadLine());
  17. double priceChinee = double.Parse(Console.ReadLine());
  18. double weihgtChinese = double.Parse(Console.ReadLine());
  19. double usStore = priceUs / 0.58;
  20. double resultUs = usStore / weightUs;
  21. double ukStore = priceUk / 0.41;
  22. double resultUk = ukStore / weightUk;
  23. double chiseStore = priceChinee * 0.27;
  24. double resultChise = (chiseStore / weihgtChinese);
  25. double min = Math.Min (Math.Min(resultUs,resultUk),resultChise);
  26. double max = Math.Max (Math.Max(resultUs,resultUk),resultChise);
  27. double difference = Math.Abs(max-min);
  28. if (resultUs < resultUk && resultUs < resultChise)
  29. {
  30. Console.WriteLine("US store. {0:F2} lv/kg",min);
  31. Console.WriteLine("Difference {0:F2} lv/kg",difference);
  32. }
  33. else if(resultUk < resultUs && resultUk < resultChise)
  34. {
  35.  
  36. Console.WriteLine("UK store. {0:F2} lv/kg", min);
  37. Console.WriteLine("Difference {0:F2} lv/kg", difference);
  38. }
  39. else if (resultChise < resultUk && resultChise < resultUs)
  40. {
  41.  
  42. Console.WriteLine("Chinese store. {0:F2} lv/kg", min);
  43. Console.WriteLine("Difference {0:F2} lv/kg", difference);
  44. }
  45.  
  46.  
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement