Advertisement
Spocoman

Oscars

Nov 24th, 2021
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 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 actor = Console.ReadLine();
  10.             double point = double.Parse(Console.ReadLine());
  11.             int jury = int.Parse(Console.ReadLine());
  12.             double sum = point;
  13.  
  14.             for (int i = 0; i < jury; i++)
  15.             {
  16.                 string judges = Console.ReadLine();
  17.                 point = double.Parse(Console.ReadLine());
  18.  
  19.                 sum += judges.Length * point / 2;
  20.  
  21.                 if (sum >= 1250.5)
  22.                 {
  23.                     break;
  24.                 }
  25.             }
  26.  
  27.             if (sum < 1250.5)
  28.             {
  29.                 Console.WriteLine($"Sorry, {actor} you need {1250.5 - sum:F1} more!");
  30.             }
  31.             else
  32.             {
  33.                 Console.WriteLine($"Congratulations, {actor} got a nominee for leading role with {sum:F1}!");
  34.             }
  35.         }
  36.     }
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement