精慕门2292661
2021-09-17 09:09
int[]num=new int[]{89,90,98,56,60,91,93,85};
string[] xingming = new string[] {"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};
int max=num[0];
for(int x=1,x < num.Length,x++)
{
if(num[i]>max)
max=num[i];
}
Console.Write(max);
Program.cs(14,26): error CS1525: Unexpected symbol `<', expecting `)', `,', `;', or `=' Program.cs(14,40): error CS1525: Unexpected symbol `++', expecting `)', `,', `;', or `=' Program.cs(18,13): error CS1525: Unexpected symbol `}' Program.cs(18,12): error CS1525: Unexpected symbol `}', expecting `)', `,', `;', or `=' Program.cs(19,26): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration Program.cs(19,30): error CS1519: Unexpected symbol `)' in class, struct, or interface member declaration Program.cs(23,0): error CS1525: Unexpected symbol `}' Compilation failed: 7 error(s), 0 warnings
int[]num=new int[]{89,90,98,56,60,91,93,85};
string[] xingming = new string[] {"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};
int max=num[0];
string name = xingming[0];
for (int i=0;i<num.Length;i++)
{
if(num[i]>max)
{
max=num[i];
name=xingming[i];
}
}
Console.Write("分数最高的是{0},分数是{1}",name,max);
在你的基础上改的,问题太多了,你自己找一下吧,最好把前面的课程再看一遍。
C#开发轻松入门
254118 学习 · 1459 问题
相似问题