Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System; using System.Globalization; using System.Threading;
- class Program { static void Main() { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
- int tom = int.Parse(Console.ReadLine()); int areaTom = int.Parse(Console.ReadLine()); int cucumber = int.Parse(Console.ReadLine()); int areaCucumber = int.Parse(Console.ReadLine()); int potato = int.Parse(Console.ReadLine()); int areaPotato = int.Parse(Console.ReadLine()); int carrot = int.Parse(Console.ReadLine()); int areaCarrot = int.Parse(Console.ReadLine()); int cabbage = int.Parse(Console.ReadLine()); int areaCabbage = int.Parse(Console.ReadLine()); int beans = int.Parse(Console.ReadLine());
- decimal TomPrice = 0.5m; decimal CarrotPrice = 0.6m; decimal CucumberPrice = 0.4m; decimal CabbagePrice = 0.3m; decimal PotatoPrice = 0.25m; decimal BeansPrice = 0.4m;
- // Calculation tu vegetables;
- decimal resaltTuVeg = ((tom * TomPrice) + (carrot * CarrotPrice) + (cucumber * CucumberPrice) + (cabbage * CabbagePrice)+(potato * PotatoPrice)+(beans * BeansPrice));
- // Calculation tu area;
- int area = 250; int resalrAreaTuVega = areaTom + areaCarrot + areaCucumber + areaCabbage + areaPotato; int areaBeans = area - resalrAreaTuVega;
- if (resalrAreaTuVega > area) { Console.WriteLine("Total costs:{0}",resaltTuVeg); Console.WriteLine("Insufficient area"); } else if (resalrAreaTuVega == area) { Console.WriteLine("Total costs:{0}",resaltTuVeg); Console.WriteLine("No area for beans"); }
- else { Console.WriteLine("Total costs:{0}",resaltTuVeg); Console.WriteLine("Beans area:{0}", areaBeans); } } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement