|
|
вернуться в форумmy code(poor English); program cgp; var n,i,j,t:integer; a,s:array[0..10000]of 0..15000; begin read(n);fillchar(a,sizeof(a),0);fillchar(s,sizeof(s),0); for i:=1 to n do begin read(a[i]); s[i]:=(a[i]+s[i-1])mod n; if s[i]=0 then begin writeln(i);for j:=1 to i do writeln(a [j]);halt;end; end; for i:=1 to n-1 do for j:=i+1 to n do if s[i]=s[j] then begin writeln(j-i); for t:=i+1 to j do writeln(a[t]);halt;end; end. Re: my code(poor English); > program cgp; > var n,i,j,t:integer; > a,s:array[0..10000]of 0..15000; > begin > read(n);fillchar(a,sizeof(a),0);fillchar(s,sizeof(s),0); > for i:=1 to n do begin > read(a[i]); > s[i]:=(a[i]+s[i-1])mod n; > if s[i]=0 then begin writeln(i);for j:=1 to i do writeln(a > [j]);halt;end; > end; > for i:=1 to n-1 do > for j:=i+1 to n do > if s[i]=s[j] then begin > writeln(j-i); > for t:=i+1 to j do writeln(a[t]);halt;end; > end. > Please don't show your programs to others again!(poorer English) I think you have seen the code on OIBH,haven't you? If so,don't show your programs again,because we all know it! Some time when you AC it today, but tomorrow you can't AC it(poorest English) > |
|
|