Advertisement
alexbancheva

Oscars_Krassy

Feb 27th, 2020
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.37 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Oscars_Krassy_Basics
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string nameActors = Console.ReadLine();
  10.             double pointsAcademy = double.Parse(Console.ReadLine());
  11.             int countsOfJury = int.Parse(Console.ReadLine());
  12.  
  13.             double totalPoints = 0;
  14.             double neededPoints = 1250.5;
  15.             double totalPointsOfJury = 0;
  16.  
  17.             for (int i = 0; i < countsOfJury; i++)
  18.             {
  19.                 string nameOfJury = Console.ReadLine();
  20.                 double pointsJ = double.Parse(Console.ReadLine());
  21.                
  22.                 double pointsOfOneJury = nameOfJury.Length * pointsJ / 2;
  23.  
  24.                 totalPoints += pointsOfOneJury;
  25.                 totalPointsOfJury = pointsAcademy + totalPoints;
  26.  
  27.                 if (totalPointsOfJury > neededPoints)
  28.                 {
  29.                     Console.WriteLine($"Congratulations, {nameActors} got a nominee for leading role with {totalPointsOfJury}!");
  30.                     break;
  31.                 }
  32.             }
  33.  
  34.  
  35.            
  36.  
  37.             if (totalPointsOfJury < neededPoints)
  38.             {
  39.                 double diff = neededPoints - totalPointsOfJury;
  40.                 Console.WriteLine($"Sorry, {nameActors} you need {diff:f1} more!");
  41.             }
  42.            
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement