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 Raindrops
- {
- class Program
- {
- static void Main(string[] args)
- {
- double n = int.Parse(Console.ReadLine());
- double technical = 0;
- double theoretical = 0;
- double practical = 0;
- double participantEarnedMoney = 0;
- for (int i = 0; i < n; i++)
- {
- double metres = double.Parse(Console.ReadLine()) * 1600;
- double kilogram = double.Parse(Console.ReadLine()) * 1000;
- string team = (Console.ReadLine());
- double fuelExpenses = 0.7 * metres * 2.5; //decimal
- double cargoIncome = 1.5 * kilogram;
- participantEarnedMoney = cargoIncome - fuelExpenses;
- //Console.WriteLine(participantEarnedMoney);
- if (team=="Technical")
- {
- technical = participantEarnedMoney;
- }
- else if (team == "Theoretical")
- {
- theoretical = participantEarnedMoney;
- }
- else if (team == "Practical")
- {
- practical = participantEarnedMoney;
- }
- }
- double end = Math.Max(technical, Math.Max(theoretical, practical));
- if (end==technical)
- {
- Console.WriteLine($"The Technical Trainers win with ${participantEarnedMoney:F3}.");
- }
- else if (end == theoretical)
- {
- Console.WriteLine($"The Theoretical Trainers win with ${participantEarnedMoney:F3}.");
- }
- else if (end == practical)
- {
- Console.WriteLine($"The Theoretical Trainers win with ${participantEarnedMoney:F3}.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement