UVA11059解题报告

因为给出的范围很小,所以直接枚举起点和终点即可,注意当最大值为负数时,此时输出0,即一个元素也不选

AC代码

#include
#include
using namespace std;

const int maxn=20;
int data[maxn];

int main()
{
    int n,T=1;
    long long maxNumber;
    while(scanf("%d",&n)==1)
    {
        maxNumber=0;
        for(int i=0;i


你可能感兴趣的:(解题报告)