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 Logistics
- {
- class Logistics
- {
- static void Main(string[] args)
- {
- var n = int.Parse(Console.ReadLine());
- int microbus = 0;
- int kamion = 0;
- int vlak = 0;
- for (int i = 0; i < n; i++)
- {
- int ton = int.Parse(Console.ReadLine());
- if (ton <= 3)
- {
- microbus += ton;
- }
- else if (ton < 11)
- {
- kamion+= ton;
- }
- else if (ton > 12)
- {
- vlak+= ton;
- }
- }
- decimal tovari = microbus + kamion + vlak;
- decimal average = (microbus * 200 + kamion * 175 + vlak * 120)/tovari;
- Console.WriteLine("{0:f2}", average);
- Console.WriteLine("{0:f2}%", microbus/tovari * 100);
- Console.WriteLine("{0:f2}%", kamion/tovari*100);
- Console.WriteLine("{0:f2}%", vlak/tovari*100);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment