Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace ConsoleApp19
- {
- struct Sportsman
- {
- public uint[] Result;
- public uint BestResult;
- public string Name;
- public Sportsman(uint[] result, string name)
- { Result = result; Name = name; BestResult = result.Max(); }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Sportsman[] sportsmen = new Sportsman[5];
- Sportsman sp1 = new Sportsman(new uint[] { 190, 221, 199 }, "Johnson"); sportsmen[0] = sp1;
- Sportsman sp2 = new Sportsman(new uint[] { 241, 217, 206 }, "Petrov"); sportsmen[1] = sp2;
- Sportsman sp3 = new Sportsman(new uint[] { 206, 180, 214 }, "Sidorov"); sportsmen[2] = sp3;
- Sportsman sp4 = new Sportsman(new uint[] { 140, 153, 171 }, "Brown"); sportsmen[3] = sp4;
- Sportsman sp5 = new Sportsman(new uint[] { 230, 208, 214 }, "Bush"); sportsmen[4] = sp5;
- Console.WriteLine("Фамилия \t Лучший результат \t Результаты");
- foreach (Sportsman sp in sportsmen)
- {
- Console.Write($"{sp.Name} \t {sp.BestResult} \t ");
- foreach (uint spresult in sp.Result)
- Console.Write($"{spresult} ");
- Console.WriteLine();
- }
- Console.Read();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement