Advertisement
MARINA_GREBENAROVA

Oscars

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