JuliaPetkova

Untitled

May 28th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 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 _2_6_15.Neighbour_Wars
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int damagePesho = int.Parse(Console.ReadLine());
  14. int damageGosho = int.Parse(Console.ReadLine());
  15.  
  16.  
  17. int pointsPesho = 100;
  18. int pointsGosho = 100;
  19.  
  20. int strike = 0;
  21. int strikePesho = 0;
  22. int strikeGosho = 0;
  23.  
  24. while ((pointsGosho > 0) && (pointsPesho > 0))
  25. {
  26.  
  27. if (strike % 3 == 0 && strike != 0)
  28. {
  29. pointsGosho = pointsGosho + 10;
  30. pointsPesho = pointsPesho + 10;
  31. }
  32.  
  33. strikePesho++;
  34. strike++;
  35. pointsGosho = pointsGosho - damagePesho;
  36.  
  37. if ((pointsGosho > 0) && (pointsPesho > 0))
  38. {
  39. Console.WriteLine($"Pesho used Roundhouse kick and reduced Gosho to {pointsGosho} health.");
  40. }
  41. else
  42. {
  43. Console.WriteLine($"Pesho won in {strike}th round.");
  44. break;
  45. }
  46.  
  47. strikeGosho++;
  48. strike++;
  49. pointsPesho = pointsPesho - damageGosho;
  50.  
  51. if ((pointsGosho > 0) && (pointsPesho > 0))
  52. {
  53. Console.WriteLine($"Gosho used Thunderous fist and reduced Pesho to {pointsPesho} health.");
  54. }
  55. else
  56. {
  57. Console.WriteLine($"Pesho won in {strike}th round.");
  58. break;
  59. }
  60.  
  61.  
  62. }
  63. }
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment