Advertisement
knoteva

Untitled

Nov 3rd, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.13 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03._Game_Statistics
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int minutes = Math.Abs(int.Parse(Console.ReadLine()));
  10.             string playerName = Console.ReadLine();
  11.  
  12.             if (minutes == 0)
  13.             {
  14.                 Console.WriteLine("Match has just began!");
  15.             }
  16.             else if (minutes < 45)
  17.             {
  18.                 Console.WriteLine("First half time.");
  19.             }
  20.             else if (minutes >= 45)
  21.             {
  22.                 Console.WriteLine("Second half time.");
  23.             }
  24.  
  25.             if (minutes <= 10 && minutes > 1)
  26.             {
  27.                 Console.WriteLine($"{playerName} missed a penalty.");
  28.  
  29.                 if (minutes % 2 == 0)
  30.                 {
  31.                     Console.WriteLine($"{playerName} was injured after the penalty.");
  32.                 }
  33.             }
  34.             else if (minutes <= 35)
  35.             {
  36.                 Console.WriteLine($"{playerName} received yellow card.");
  37.  
  38.                 if (minutes % 2 != 0)
  39.                 {
  40.                     Console.WriteLine($"{playerName} got another yellow card.");
  41.                 }
  42.             }
  43.             else if (minutes < 45)
  44.             {
  45.                 Console.WriteLine($"{playerName} SCORED A GOAL !!!");
  46.             }
  47.             else if (minutes > 45 && minutes <= 55)
  48.             {
  49.                 Console.WriteLine($"{playerName} got a freekick.");
  50.  
  51.                 if (minutes % 2 == 0)
  52.                 {
  53.                     Console.WriteLine($"{playerName} missed the freekick.");
  54.                 }
  55.             }
  56.             else if (minutes <= 80)
  57.             {
  58.                 Console.WriteLine($"{playerName} missed a shot from corner.");
  59.  
  60.                 if (minutes % 2 != 0)
  61.                 {
  62.                     Console.WriteLine($"{playerName} has been changed with another player.");
  63.                 }
  64.             }
  65.             else if (minutes <= 90)
  66.             {
  67.                 Console.WriteLine($"{playerName} SCORED A GOAL FROM PENALTY !!!");
  68.             }
  69.  
  70.         }
  71.     }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement