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();
- //2. Четем от конзолата първоначални точки
- double points = double.Parse(Console.ReadLine());
- //3. Четем от конзолата брой оценяващи - n
- int n = int.Parse(Console.ReadLine());
- string assessorName;
- double assessorPoints;
- //4. Пускаме цикъл, който да се изпълнява за всеки 1 оценяващ
- for (int i = 1; i <= n; i++)
- {
- // => за всеки оценяващ четем: името му и точките, които дава
- assessorName = Console.ReadLine();
- assessorPoints = double.Parse(Console.ReadLine());
- // => добавяме точките към общия брой точки
- points = points + (assessorName.Length*assessorPoints/2);
- //points += (assessorName.Length*assessorPoints/2);
- // => проверяваме дали актьора е получил достатъчно точки (1250.5)
- if (points>=1250.5)
- {
- Console.WriteLine($"Congratulations, {actorName} got a nominee for leading role with {points:f1}!");
- break;
- }
- }
- //5. Проверяваме дали точките са по-малко от 1250.5
- if (points < 1250.5)
- {
- Console.WriteLine($"Sorry, {actorName} you need {1250.5-points:f1} more!");
- }
- }
- }
- }
Advertisement
Advertisement