Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Condition_Statement_Loop
- {
- class Program
- {
- static void Main(string[] args)
- {
- NeighbourWars();
- }
- private static void NeighbourWars()
- {
- var peshoDamage = int.Parse(Console.ReadLine());
- var goshoDamage = int.Parse(Console.ReadLine());
- //
- var peshoHealth = 100;
- var goshoHealth = 100;
- //
- var round = 0;
- while (true)
- {
- if (round % 2 == 0)
- {
- round++;
- goshoHealth -= peshoDamage;
- if (goshoHealth <= 0)
- {
- Console.WriteLine($"Pesho won in {round}th round.");
- break;
- }
- else
- {
- Console.Write("Pesho used Roundhouse kick and reduced ");
- Console.WriteLine($"Gosho to {goshoHealth} health.");
- }
- }
- else
- {
- round++;
- peshoHealth -= goshoDamage;
- if (peshoHealth <= 0)
- {
- Console.WriteLine($"Gosho won in {round}th round.");
- break;
- }
- else
- {
- Console.Write("Gosho used Thunderous fist and reduced");
- Console.WriteLine($" Pesho to {peshoHealth} health.");
- }
- }
- if (round % 3 == 0 && (peshoHealth > 0 || goshoHealth > 0))
- {
- peshoHealth += 10;
- goshoHealth += 10;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement