miroslavbstoyanov

Untitled

Sep 26th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace neigbourswars
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int pDamage = int.Parse(Console.ReadLine());
  14. int gDamage = int.Parse(Console.ReadLine());
  15.  
  16. int pHealth = 100, gHealth = 100;
  17. string pAttack = "Roundhouse kick", gAttack = "Thunderous fist";
  18. int round = 1;
  19. while (true)
  20. {
  21. if (round % 2 != 0)
  22. {
  23. gHealth = gHealth - pDamage;
  24. if (gHealth <= 0)
  25. {
  26. Console.WriteLine("Pesho won in {0}th round.", round);
  27. return;
  28. }
  29. else
  30. {
  31. Console.WriteLine("Pesho used {0} and reduced Gosho to {1} health.", pAttack, gHealth);
  32. }
  33.  
  34.  
  35. }
  36. else
  37. {
  38. pHealth = pHealth - gDamage;
  39. if (pHealth <= 0)
  40. {
  41. Console.WriteLine("Gosho won in {0}th round.", round);
  42. return;
  43. }
  44. else
  45. {
  46. Console.WriteLine("Gosho used {0} and reduced Pesho to {1} health.", gAttack, pHealth);
  47. }
  48.  
  49. }
  50. if (round % 3 == 0)
  51. {
  52. pHealth += 10;
  53. gHealth += 10;
  54. }
  55. round++;
  56.  
  57. }
  58. }
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment