Advertisement
TeMePyT

Untitled

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