|
|
вернуться в форумwhy i got wa??? this is my program: program df(input,output); var ai:array[1..3000] of integer; aj:array[1..3000] of real; c:array[1..3000] of real; i,j,n,m,k:integer; a0,an1,a1,d:real; procedure p(i,k:integer;d:real); begin if i=n+2 then begin a1:=(an1-d)/k; writeln(a1:4:2); end else begin ai[i]:=2*k-ai[i-2]; k:=ai[i]; aj[i]:=2*d+2*c[i-1]-aj[i-2]; d:=aj[i]; p(i+1,k,d); end; end; begin readln(n); readln(a0); readln(an1); for i:=1 to n do readln(c[i]); if n=0 then begin writeln(an1:4:2); halt; end; if n=1 then begin writeln(((a0+an1)/2-c[1]):4:2); halt; end; k:=2;d:=2*c[1]-a0; ai[1]:=1; aj[1]:=0; p(3,k,d); end. why i got wa??? Test (+) 3 0 4 0 0 0 answer=1 ----- The sequence is: 0 1 2 3 4 thanks>> thank you very much.(by geniushjs)this is my E-mail:geniushjs@tom.com |
|
|