ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1001. Reverse Root

Can anybody help me? What's wrong?[Pascal]
Posted by Alex.pas 3 Nov 2011 21:05
program z1001;
var a:array[1..1000000] of int64;
    i,j:longint;
begin
i:=1;
while not seekeof do begin read(a[i]); i:=i+1; end;
for j:=i downto 1 do writeln(sqrt(a[j]):0:4);
end.

I have WA#1 and don't understand why
Re: Can anybody help me? What's wrong?[Pascal]
Posted by Neo 1 Jan 2012 22:57
program z1001;
var a:array[1..1000000] of int64;
    i,j:longint;
begin
i:=1;
while not seekeof do begin read(a[i]); i:=i+1; end;

AHTUNG you missed here - i:=i-1; that;s all=)

for j:=i downto 1 do writeln(sqrt(a[j]):0:4);
end.