为了账号安全,请及时绑定邮箱和手机立即绑定

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

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


正在回答

2 回答

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

                                  ?多了个 |

0 回复 有任何疑惑可以回复我~
#1

想要超能力丶 提问者

非常感谢!
2018-08-07 回复 有任何疑惑可以回复我~

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

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

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

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号