Advertisement
viraco4a

15. Neighbour Wars

May 22nd, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. using System;
  2.  
  3. namespace NeighBourFight
  4. {
  5. class Program
  6. {
  7. static void Main()
  8. {
  9. var peshoDamage = int.Parse(Console.ReadLine());
  10. var goshoDamage = int.Parse(Console.ReadLine());
  11. int peshoHP = 100;
  12. int goshoHP = 100;
  13. int turn = 0;
  14. do
  15. {
  16. if (turn % 2 == 0)
  17. {
  18. goshoHP -= peshoDamage;
  19. if (goshoHP <= 0)
  20. {
  21. Console.WriteLine($"Pesho won in {turn + 1}th round.");
  22. return;
  23. }
  24. Console.WriteLine($"Pesho used Roundhouse kick and reduced Gosho to {goshoHP} health.");
  25. }
  26. else
  27. {
  28. peshoHP -= goshoDamage;
  29. if (peshoHP <= 0)
  30. {
  31. Console.WriteLine($"Gosho won in {turn + 1}th round.");
  32. return;
  33. }
  34. Console.WriteLine($"Gosho used Thunderous fist and reduced Pesho to {peshoHP} health.");
  35. }
  36.  
  37. if ((turn + 1) % 3 == 0)
  38. {
  39. peshoHP += 10;
  40. goshoHP += 10;
  41. }
  42.  
  43. turn++;
  44. } while (true);
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement