Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- namespace ConsoleApp19
- {
- class 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)
- {
- string path = @"G:\surnames.txt";
- StreamReader sr = new StreamReader(path, Encoding.GetEncoding(1251));
- Sportsman[] sportsmen = new Sportsman[5];
- Sportsman sp1 = new Sportsman(new uint[] { 190, 221, 199 }, sr.ReadLine()); sportsmen[0] = sp1;
- Sportsman sp2 = new Sportsman(new uint[] { 241, 217, 206 }, sr.ReadLine()); sportsmen[1] = sp2;
- Sportsman sp3 = new Sportsman(new uint[] { 206, 180, 214 }, sr.ReadLine()); sportsmen[2] = sp3;
- Sportsman sp4 = new Sportsman(new uint[] { 140, 153, 171 }, sr.ReadLine()); sportsmen[3] = sp4;
- Sportsman sp5 = new Sportsman(new uint[] { 230, 208, 214 }, sr.ReadLine()); sportsmen[4] = sp5;
- Console.ForegroundColor = ConsoleColor.Cyan;
- Console.WriteLine(" Фамилия \t Лучший результат \t Результаты");
- Console.ResetColor();
- 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