|
|
вернуться в форумMy program is wrong !!!??? But I think it is right?? Help me please!!! ------------------------------------- var s,n,sum,i,j,k,a:longint; procedure solve(i:integer); var j:integer; begin for j:=i to s do readln; end; begin readln(s,n); k:=0; for i:=1 to s do begin read(a); inc(k); if a<>0 then sum:=sum+a else begin if sum>k+n then begin solve(i); write('No'); halt; end else if sum<k then begin sum:=0; k:=0; end end; end; if sum>k+n then write('No') else write('Yes'); end. ---------------------------------- Thank you!!! Wrong solution (+) Just think when it is most likely the inequality won't be true ! When You realize it You'll get AC ! |
|
|