Advertisement
aggressiveviking

Untitled

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