美文网首页
无标题文章

无标题文章

作者: _sunnyRain | 来源:发表于2018-04-02 21:57 被阅读0次

    #include

    #include

    intmain()

    {

        intcount;

        inta[100];

        intb[100];

        inti;

        intmax;

        scanf("%d",&count);

        for(i=0; i

        {

            scanf("%d",&a[i]);

        }

        b[0]=a[0];

        max=b[0];

        for(i=1; i

        {

            if(b[i-1]>0)

                b[i]=b[i-1]+a[i];

            else

                b[i]=a[i];

            if(b[i]>max)

                max=b[i];

        }

        printf("%d\n",max);

        return0;

    }

    相关文章

      网友评论

          本文标题:无标题文章

          本文链接:https://www.haomeiwen.com/subject/stykbxtx.html