Advertisement
i_jaguar

Untitled

May 20th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _15._Neighbour_Wars
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9.  
  10. int damagePesho = int.Parse(Console.ReadLine());
  11. int damageGosho = int.Parse(Console.ReadLine());
  12.  
  13. int healthPesho = 100;
  14. int healthGosho = 100;
  15. int x = 0;
  16.  
  17. if (damageGosho==damagePesho && damageGosho == 0)
  18. {
  19. Console.WriteLine("Pesho won in 1th round.");
  20. return;
  21. }
  22.  
  23. for (int i = 1; i > 0; i++)
  24. {
  25. x++;
  26.  
  27. if (i % 2 != 0)
  28. {
  29. healthGosho -= damagePesho;
  30. if (healthGosho > 0)
  31. {
  32. Console.WriteLine($"Pesho used Roundhouse kick and reduced Gosho to {healthGosho} health.");
  33. }
  34. }
  35. else
  36. {
  37. healthPesho -= damageGosho;
  38. if (healthPesho > 0)
  39. {
  40. Console.WriteLine($"Gosho used Thunderous fist and reduced Pesho to {healthPesho} health.");
  41. }
  42. }
  43. if (i % 3 == 0)
  44. {
  45. healthGosho += 10;
  46. healthPesho += 10;
  47. }
  48.  
  49.  
  50. if (healthGosho <= 0)
  51. {
  52. Console.WriteLine($"Pesho won in {x}th round.");
  53. return;
  54. }
  55. if (healthPesho <= 0)
  56. {
  57. Console.WriteLine($"Gosho won in {x}th round.");
  58. return;
  59. }
  60. }
  61.  
  62. }
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement