Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Arrays;
- using System;
- using System.Collections.Generic;
- public class Program
- {
- public static void Main()
- {
- Team team = new Team("Chelsea");
- int countPlayers = int.Parse(Console.ReadLine());
- for (int player = 1; player <= countPlayers; player++)
- {
- string data = Console.ReadLine();//"Asen Ivanov 20 2200"
- string[] splittedData = data.Split(" ");
- //["Asen", "Ivanov", "20", "2200"]
- string firstName = splittedData[0]; //"Asen"
- string lastName = splittedData[1]; //"Ivanov"
- int age = int.Parse(splittedData[2]); //"20" -> 20
- double salary = double.Parse(splittedData[3]); // "2200" -> 2200
- Person person = new Person(firstName, lastName, age, salary);
- team.AddPlayer(person);
- }
- Console.WriteLine($"First team have {team.FirstTeam.Count} players");
- Console.WriteLine($"Reserve team have {team.ReserveTeam.Count} players");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment