Advertisement
Daniel_007

03. Game Statistics

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