问答详情
源自:6-1 练习题目

自己的思路,想知道问题出在哪

        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]);


提问者:想要超能力丶 2018-08-05 00:47

个回答

  • ss5ssmi
    2018-08-06 14:06:47
    已采纳

    if(score[i]<score[i+1]| && temp<score[i+1])

                                      ?多了个 |

  • 想要超能力丶
    2018-08-05 08:38:34

    换了个思路做出来了,但仍然不知道这个思路哪里错了,报错提示好像“&&”字符用错了,求大佬