Advertisement
IvetValcheva

06. Oscars

Nov 22nd, 2021
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp3
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string actorName = Console.ReadLine();
  10.             double academyPoints = double.Parse(Console.ReadLine());
  11.             int n = int.Parse(Console.ReadLine());
  12.  
  13.             for (int i = 1; i <=n; i++)
  14.             {
  15.                 string assessorName = Console.ReadLine();
  16.                 double points = double.Parse(Console.ReadLine());
  17.  
  18.                 academyPoints += (assessorName.Length * points / 2);
  19.  
  20.                 if (academyPoints >= 1250.5)
  21.                 {
  22.                     break;
  23.                 }
  24.             }
  25.  
  26.             if (academyPoints >= 1250.5)
  27.             {
  28.                 Console.WriteLine($"Congratulations, {actorName} got a nominee for leading role with {academyPoints:F1}!");
  29.             }
  30.             else
  31.             {
  32.                 Console.WriteLine($"Sorry, {actorName} you need {(1250.5 - academyPoints):F1} more!");
  33.             }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement