想要超能力丶
2018-08-05 00:47
static void Main(string[] args)
{
int[] score = {89,90,98,56,60,91,93,85};
string[] Name = {"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};
int temp = 0;
int high = 0;
for(int i = 0;i<score.Length-1;i++)
{
if(score[i]<score[i+1]| && temp<score[i+1])
{
temp = score[i+1];
}
else if(score[i]>score[i+1] && temp<score[i])
{
temp = score[i];
}
else
{
continue;
}
}
for(int a=0;a<score.Length;a++)
{
if(temp == score[a])
{
high = a;
}
}
Console.Write("分数最高的是{0},分数是{1}",Name[high],score[high]);
if(score[i]<score[i+1]| && temp<score[i+1])
?多了个 |
换了个思路做出来了,但仍然不知道这个思路哪里错了,报错提示好像“&&”字符用错了,求大佬
C#开发轻松入门
255542 学习 · 1485 问题
相似问题