Advertisement
Angel04172002

Oscars c#

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