Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _01Nacepin
- {
- class Nacepin
- {
- static void Main(string[] args)
- {
- double priceUs = double.Parse(Console.ReadLine());
- double weightUs = double.Parse(Console.ReadLine());
- double priceUk = double.Parse(Console.ReadLine());
- double weightUk = double.Parse(Console.ReadLine());
- double priceChinee = double.Parse(Console.ReadLine());
- double weihgtChinese = double.Parse(Console.ReadLine());
- double usStore = priceUs / 0.58;
- double resultUs = usStore / weightUs;
- double ukStore = priceUk / 0.41;
- double resultUk = ukStore / weightUk;
- double chiseStore = priceChinee * 0.27;
- double resultChise = (chiseStore / weihgtChinese);
- double min = Math.Min (Math.Min(resultUs,resultUk),resultChise);
- double max = Math.Max (Math.Max(resultUs,resultUk),resultChise);
- double difference = Math.Abs(max-min);
- if (resultUs < resultUk && resultUs < resultChise)
- {
- Console.WriteLine("US store. {0:F2} lv/kg",min);
- Console.WriteLine("Difference {0:F2} lv/kg",difference);
- }
- else if(resultUk < resultUs && resultUk < resultChise)
- {
- Console.WriteLine("UK store. {0:F2} lv/kg", min);
- Console.WriteLine("Difference {0:F2} lv/kg", difference);
- }
- else if (resultChise < resultUk && resultChise < resultUs)
- {
- Console.WriteLine("Chinese store. {0:F2} lv/kg", min);
- Console.WriteLine("Difference {0:F2} lv/kg", difference);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement