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 _04.Logistics
- {
- class Program
- {
- static void Main(string[] args)
- {
- int countOfLoads = int.Parse(Console.ReadLine());
- int sumTons = 0;
- double microbus = 0;
- double truck = 0;
- double train = 0;
- for (int i = 1; i <= countOfLoads; i++)
- {
- int tons = int.Parse(Console.ReadLine());
- if (tons <= 3)
- {
- microbus += tons;
- }
- else if (tons >= 4 && tons <= 11)
- {
- truck += tons;
- }
- else if (tons >= 12)
- {
- train += tons;
- }
- sumTons += tons;
- }
- double microbusPrice = microbus * 200.0;
- double truckPrice = truck * 175.0;
- double trainPrice = train * 120.0;
- double totalPrice = microbusPrice + truckPrice + trainPrice;
- Console.WriteLine("{0:f2}" , totalPrice / sumTons);
- Console.WriteLine("{0:f2}%", (microbus / sumTons) * 100);
- Console.WriteLine("{0:f2}%", (truck / sumTons) * 100);
- Console.WriteLine("{0:f2}%", (train / sumTons) * 100);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement