自己的思路,想知道問題出在哪
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? int[] score = {89,90,98,56,60,91,93,85};
? ? ? ? ? ? string[] Name = {"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};
? ? ? ? ? ? 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("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}",Name[high],score[high]);
2018-08-06
if(score[i]<score[i+1]|?&& temp<score[i+1])
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?多了個 |
2018-08-05
換了個思路做出來了,但仍然不知道這個思路哪里錯了,報錯提示好像“&&”字符用錯了,求大佬