简答题 偏难
#23867

Program exp1 (imput,output); Var i, s, max: integer; a :array [1..10] of integer…

Program  exp1  (imput,output);                                   

        Var  i,  s,  max: integer;

             a    :array [1..10]  of  integer;

        begin 

          for i:=1 to 10  do   read (a[i]);

          max:=a[1] ;s:=a[1];

          for i:=2  to  10  do 

            begin 

              if  s<0  then  s:=0;               

                 s:= s+a[i];                    

           if s>max  then  max:=s

        end;

      writeln(‘max=’, max)

   end.  

      输入:-2  13  -1  4  7  8  -1  -18  24  6

      输出:max=

未登录也能判分,登录后才会记录
答案与解析
正确答案:(缺答案,待补录)
这道题暂未补解析。