Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Oscars_Krassy_Basics
- {
- class Program
- {
- static void Main(string[] args)
- {
- string nameActors = Console.ReadLine();
- double pointsAcademy = double.Parse(Console.ReadLine());
- int countsOfJury = int.Parse(Console.ReadLine());
- double totalPoints = 0;
- double neededPoints = 1250.5;
- double totalPointsOfJury = 0;
- for (int i = 0; i < countsOfJury; i++)
- {
- string nameOfJury = Console.ReadLine();
- double pointsJ = double.Parse(Console.ReadLine());
- double pointsOfOneJury = nameOfJury.Length * pointsJ / 2;
- totalPoints += pointsOfOneJury;
- totalPointsOfJury = pointsAcademy + totalPoints;
- if (totalPointsOfJury > neededPoints)
- {
- Console.WriteLine($"Congratulations, {nameActors} got a nominee for leading role with {totalPointsOfJury}!");
- break;
- }
- }
- if (totalPointsOfJury < neededPoints)
- {
- double diff = neededPoints - totalPointsOfJury;
- Console.WriteLine($"Sorry, {nameActors} you need {diff:f1} more!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement