Advertisement
IvetValcheva

06. Oscars

Jan 31st, 2022
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Oscars
  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 assessorPoints = double.Parse(Console.ReadLine());
  17.  
  18.                 //academyPoints=academyPoints+assessorName.Length*assessorPoints/2;
  19.  
  20.                 academyPoints += assessorName.Length * assessorPoints / 2;
  21.  
  22.                 if (academyPoints >= 1250.5)
  23.                 {
  24.                     Console.WriteLine($"Congratulations, {actorName} got a nominee for leading role with {academyPoints:f1}!");
  25.                     break;
  26.                 }
  27.             }
  28.  
  29.             if (academyPoints < 1250.5)
  30.             {
  31.                 Console.WriteLine($"Sorry, {actorName} you need {1250.5-academyPoints:f1} more!");
  32.             }
  33.         }
  34.     }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement