C#C
C#3y ago
Tony

❔ Program does not contain static 'Main'

using System.Collections.Specialized;
using System.Security.Cryptography.X509Certificates;
class Player
{
    public string _playerName;
    public int playerID;
    public Player(string playerName, int playerIdentifier)
    {
        _playerName = playerName;
        playerID = playerIdentifier;
    }
}
class Program
{
    List<Player> Players = new List<Player>();
    void banPlayer(string _playerBan)
    {
        foreach (Player _player in Players)
        {
            if (_player._playerName == _playerBan)
            {
                Players.Remove(_player);
                Console.WriteLine("ID: " + _player.playerID + " has been removed");
            }
        }
    }
    public void Main()
    {
        string[] input;
        while (Players.Count < 5)
        {
            input = Console.ReadLine().Split(' ');
            Player player = new Player(input[0], Int32.Parse(input[1]));
            Players.Add(player);
        }
        banPlayer(Console.ReadLine());

    }
}
image.png
Was this page helpful?