Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace PokemonBattles
- {
- using System;
- public class PokemonBattles
- {
- public static void Main()
- {
- int firstPlayersPokemons = int.Parse(Console.ReadLine());
- int secondPlayersPokemons = int.Parse(Console.ReadLine());
- int totalBattles = int.Parse(Console.ReadLine());
- int battleCounter = 0;
- bool tournamentFinished = false;
- for (int firstPokemon = 1; firstPokemon <= firstPlayersPokemons; firstPokemon++)
- {
- for (int secondPokemon = 1; secondPokemon <= secondPlayersPokemons; secondPokemon++)
- {
- Console.Write($"({firstPokemon} <-> {secondPokemon}) ");
- battleCounter++;
- if (battleCounter == totalBattles)
- {
- tournamentFinished = true;
- break;
- }
- }
- if (tournamentFinished)
- {
- break;
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment