pavlinpetkov88

Battles

Nov 28th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. using System;
  2.  
  3. class Battles
  4. {
  5. static void Main()
  6.  
  7. {
  8.  
  9. int playerOne = int.Parse(Console.ReadLine());
  10. int playerTwo = int.Parse(Console.ReadLine());
  11. int numberOfBattles = int.Parse(Console.ReadLine());
  12.  
  13. int counter = 0;
  14.  
  15. for (int i = 1; i <= playerOne; i++)
  16. {
  17. for (int j = 1; j <= playerTwo ; j++)
  18. {
  19. counter++;
  20. if (counter > numberOfBattles)
  21. {
  22. break;
  23. }
  24. Console.Write("({0} <-> {1}) ", i, j);
  25. }
  26. }
  27.  
  28. }
  29. }
Add Comment
Please, Sign In to add comment