Advertisement
filipovv

#15

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