Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace neigbourswars
- {
- class Program
- {
- static void Main(string[] args)
- {
- int pDamage = int.Parse(Console.ReadLine());
- int gDamage = int.Parse(Console.ReadLine());
- int pHealth = 100, gHealth = 100;
- string pAttack = "Roundhouse kick", gAttack = "Thunderous fist";
- int round = 1;
- while (true)
- {
- if (round % 2 != 0)
- {
- gHealth = gHealth - pDamage;
- if (gHealth <= 0)
- {
- Console.WriteLine("Pesho won in {0}th round.", round);
- return;
- }
- else
- {
- Console.WriteLine("Pesho used {0} and reduced Gosho to {1} health.", pAttack, gHealth);
- }
- }
- else
- {
- pHealth = pHealth - gDamage;
- if (pHealth <= 0)
- {
- Console.WriteLine("Gosho won in {0}th round.", round);
- return;
- }
- else
- {
- Console.WriteLine("Gosho used {0} and reduced Pesho to {1} health.", gAttack, pHealth);
- }
- }
- if (round % 3 == 0)
- {
- pHealth += 10;
- gHealth += 10;
- }
- round++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment