Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _6._Oscars
- {
- class Program
- {
- static void Main(string[] args)
- {
- //1. Четем от конзолата:
- // => име на актьор/актриса
- string actorName = Console.ReadLine();
- // => първоначален брой точки
- double points = double.Parse(Console.ReadLine());
- // => брой оценяващи
- int n = int.Parse(Console.ReadLine());
- string assessorName;
- double assessorPoints;
- //2. Създаваме цикъл, който да се изп. за всеки оценяващ
- for (int assessor = 1; assessor <=n; assessor++)
- {
- // => четем име на оценяващия
- assessorName = Console.ReadLine();
- // => четем точки от оценяващия
- assessorPoints = double.Parse(Console.ReadLine());
- // => към точките до момента добавяме:
- points = points + assessorName.Length * assessorPoints / 2;
- //points += assessorName.Length * assessorPoints / 2;
- if (points >= 1250.5)
- {
- Console.WriteLine($"Congratulations, {actorName} got a nominee for leading role with {points:f1}!");
- break;
- }
- }
- //3. Проверяваме дали точките са <1250.5
- if (points < 1250.5)
- {
- Console.WriteLine($"Sorry, {actorName} you need {1250.5-points:f1} more!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement