Advertisement
IvanBorisovG

NeighbourWars

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