JuliaPetkova

Untitled

May 28th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 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 damageGosho = int.Parse(Console.ReadLine());
  14. int damagePesho = 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. strikePesho++;
  27. strike++;
  28. pointsGosho = pointsGosho - damageGosho;
  29.  
  30. if (strike % 3 == 0 && strike != 0)
  31. {
  32. pointsGosho = pointsGosho + 10;
  33. pointsPesho = pointsPesho + 10;
  34. }
  35.  
  36. if ((pointsGosho >= 0) && (pointsPesho >= 0))
  37. {
  38. Console.WriteLine($"Pesho used Roundhouse kick and reduced Gosho to {pointsGosho} health.");
  39. }
  40. else
  41. {
  42. Console.WriteLine($"Pesho won in {strike}th round.");
  43. break;
  44. }
  45.  
  46. strikeGosho++;
  47. strike++;
  48. pointsPesho = pointsPesho - damagePesho;
  49. if (strike % 3 == 0 && strike != 0)
  50. {
  51. pointsGosho = pointsGosho + 10;
  52. pointsPesho = pointsPesho + 10;
  53. }
  54.  
  55. if ((pointsGosho > 0) && (pointsPesho > 0))
  56. {
  57. Console.WriteLine($"Gosho used Thunderous fist and reduced Pesho to {pointsPesho} health.");
  58. }
  59. else
  60. {
  61. Console.WriteLine($"Pesho won in {strike}th round.");
  62. break;
  63. }
  64. }
  65. }
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment