NewInCSharp

Untitled

Nov 28th, 2019
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.38 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Gymnastics
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string country = Console.ReadLine();
  10.             string instrument = Console.ReadLine();
  11.  
  12.             double juryScore = 0;
  13.             double dificult = 0;
  14.             double presentation = 0;
  15.            
  16.  
  17.             if (country == "Russia")
  18.             {
  19.                 if (instrument == "ribbin")
  20.                 {
  21.                     dificult = 9.100;
  22.                     presentation = 9.400;
  23.                 }
  24.                 else if (instrument == "hoop")
  25.                 {
  26.                     dificult = 9.300;
  27.                     presentation = 9.800;
  28.                 }
  29.                 else if (instrument == "rope")
  30.                 {
  31.                     dificult = 9.600;
  32.                     presentation = 9.000;
  33.                 }
  34.             }
  35.             else if (country == "Bulgaria")
  36.             {
  37.                 if (instrument == "ribbin")
  38.                 {
  39.                     dificult = 9.600;
  40.                     presentation = 9.400;
  41.                 }
  42.                 else if (instrument == "hoop")
  43.                 {
  44.                     dificult = 9.550;
  45.                     presentation = 9.750;
  46.                 }
  47.                 else if (instrument == "rope")
  48.                 {
  49.                     dificult = 9.500;
  50.                     presentation = 9.400;
  51.                 }
  52.             }
  53.             else if (country == "Italy")
  54.             {
  55.                 if (instrument == "ribbin")
  56.                 {
  57.                     dificult = 9.200;
  58.                     presentation = 9.500;
  59.                 }
  60.                 else if (instrument == "hoop")
  61.                 {
  62.                     dificult = 9.450;
  63.                     presentation = 9.350;
  64.                 }
  65.                 else if (instrument == "rope")
  66.                 {
  67.                     dificult = 9.700;
  68.                     presentation = 9.150;
  69.                 }
  70.             }
  71.             double finalScore = dificult + presentation;
  72.             double maxScore = 20;
  73.             double score = maxScore - finalScore;
  74.             double scoreNeeded = (score / maxScore) * 100;
  75.  
  76.             Console.WriteLine($"The team of {country} get {score:f3} on {instrument}.");
  77.             Console.WriteLine($"{scoreNeeded:f2}%");
  78.         }
  79.     }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment