Advertisement
desislava_topuzakova

06. Oscars

Jul 25th, 2022
1,155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 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 numberJudges = int.Parse(Console.ReadLine());
  12.             double countPoints = academyPoints;
  13.  
  14.  
  15.  
  16.             for (int judge = 1; judge  <= numberJudges; judge ++)
  17.             {
  18.                 string judgeName = Console.ReadLine();
  19.                 double judgePoints = double.Parse(Console.ReadLine());
  20.                 countPoints += (judgeName.Length * judgePoints) / 2;
  21.  
  22.                 if (countPoints > 1250.5)
  23.                 {
  24.                     Console.WriteLine($"Congratulations, {actorName} got a nominee for leading role with {countPoints:f1}!");
  25.                     break;
  26.                 }
  27.                
  28.             }
  29.  
  30.            
  31.             if (countPoints <= 1250.5)
  32.             {
  33.                 double diff = 1250.5 - countPoints;
  34.                 Console.WriteLine($"Sorry, {actorName} you need {diff:f1} more!");
  35.             }
  36.  
  37.         }
  38.     }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement