Advertisement
loter

Untitled

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