LachoTodorov

Untitled

May 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.57 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P15
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int peshoDmg = int.Parse(Console.ReadLine());
  10.             int goshoDmg = int.Parse(Console.ReadLine());
  11.  
  12.             int turn = 0;
  13.             int peshoHealth = 100;
  14.             int goshoHealth = 100;
  15.  
  16.             while (true)
  17.             {
  18.                 turn++;
  19.                 if (goshoHealth <= 0)
  20.                 {
  21.                     Console.WriteLine($"Pesho won in {turn}th round.");
  22.                     Environment.Exit(0);
  23.                 }
  24.                 else if (peshoHealth <= 0)
  25.                 {
  26.                     Console.WriteLine($"Gosho won in {turn}th round.");
  27.                     Environment.Exit(0);
  28.                 }
  29.                 else if (turn % 2 == 0)
  30.                 {
  31.                     goshoHealth -= peshoDmg;
  32.                     Console.WriteLine($"Pesho used Roundhouse kick and reduced Gosho to {goshoHealth} health.");
  33.                 }
  34.                 else if (turn % 3 == 0)
  35.                 {
  36.                     peshoHealth -= goshoDmg;
  37.                     Console.WriteLine($"Gosho used Thunderous fist and reduced Pesho to {peshoHealth} health.");
  38.                     goshoHealth += 10;
  39.                     peshoHealth += 10;
  40.                 }
  41.                 else
  42.                 {
  43.                     peshoHealth -= goshoDmg;
  44.                     Console.WriteLine($"Gosho used Thunderous fist and reduced Pesho to {peshoHealth} health.");
  45.                 }
  46.             }
  47.         }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment