Advertisement
kirililchev3

Neighbour Wars ***

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