C# Сделать в C#
Помогите сделать

Ответы
Ответ:
struct Auto
{
public string Name;
public string Mark;
public string Color;
public int Cost;
}
class Programm
{
static int Max(Auto[] args)
{
int cost = args[0].Cost;
int index = 0;
for(int j = 0; j < args.Length; j++)
{
if (args[j].Cost > cost)
{
cost = args[j].Cost;
index = j;
}
}
return index;
}
public static void Answer(Auto[] args)
{
System.Console.Clear();
int i = Max(args);
System.Console.WriteLine($"{args[i].Name}, {args[i].Cost}, {args[i].Mark}, {args[i].Color}");
string input = System.Console.ReadLine();
foreach(Auto k in args)
{
if (k.Name == input)
{
System.Console.WriteLine($"{k.Name}, {k.Mark}, {k.Color}, {k.Cost}");
return;
}
}
System.Console.WriteLine("Wrong name!");
Answer(args);
}
}