daily pastebin goal
41%
SHARE
TWEET

NeighbourWars

a guest Jan 29th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace P15NeighbourWars
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int peshoDamage = int.Parse(Console.ReadLine());
  10.             int goshoDamage = int.Parse(Console.ReadLine());
  11.  
  12.             int round = 0;
  13.             int peshoHp = 100;
  14.             int goshoHp = 100;
  15.             string winnerName = "";
  16.  
  17.             while (peshoHp > 0 && goshoHp > 0)
  18.             {
  19.                 round++;
  20.  
  21.                 if (round % 2 == 1)
  22.                 {
  23.                     goshoHp -= peshoDamage;
  24.                    
  25.                     if (goshoHp <= 0)
  26.                     {
  27.                         winnerName = "Pesho";
  28.                         break;
  29.                     }
  30.  
  31.                     Console.WriteLine($"Pesho used Roundhouse kick and reduced Gosho to {goshoHp} health.");
  32.                 }
  33.                 else
  34.                 {
  35.                     peshoHp -= goshoDamage;
  36.  
  37.                     if (peshoHp <= 0)
  38.                     {
  39.                         winnerName = "Gosho";
  40.                         break;
  41.                     }
  42.  
  43.                     Console.WriteLine($"Gosho used Thunderous fist and reduced Pesho to {peshoHp} health.");
  44.                 }
  45.  
  46.                 if (round % 3 == 0)
  47.                 {
  48.                     goshoHp += 10;
  49.                     peshoHp += 10;
  50.                 }
  51.  
  52.             }
  53.  
  54.             Console.WriteLine($"{winnerName} won in {round}th round.");
  55.  
  56.             //main ends here
  57.         }
  58.     }
  59. }
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top