|
|
back to boardwa6 pascal var k,n,i,sum,s:integer; begin readln(k,n); sum:=0; for i:=1 to n do begin readln(s); sum:=sum+s-k; if sum<0 then sum:=0; end; //sum:=sum+s-k; //if sum<0 then sum:=0; writeln(sum); readln; end. whot wrong? Re: wa6 pascal Edited by author 06.11.2012 01:22 Re: wa6 pascal var k,n,i,sum,s:integer; begin readln(k,n); sum:=0; for i:=1 to n do begin read(s); // here must be read. not readln; sum:=sum+s-k; if sum<0 then sum:=0; end; //sum:=sum+s-k; //if sum<0 then sum:=0; writeln(sum); end. whot wrong? |
|
|