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

Show all messages Hide all messages

What's wrong with my code? (Pascal) genchildren 15 Dec 2016 22:25
var j,i,n:longint;
m:array of real;
begin
n:=1;
while not seekeof do
begin
read(j);
SetLength(m,n);
m[n]:=sqrt(j);
inc(n);
end;
for i:=n to 1 do
writeln(m[i]:0:4);
end.
1. chek type of j. You may have input = 10^18, but max in longint ≈ 2*10^9.
2. Write size of array.
2. Don't know what this is: SetLength(m,n); delete this nah)
3. for i:=n to 1 do    |=>   for i:=n downto 1 do
4. Chek why for this input: 9.
your output is 0.0000 3.0000
little change your programm and get AC))

Edited by author 18.12.2016 03:29
Re: What's wrong with my code? (Pascal) genchildren 19 Dec 2016 19:39
AC now, thank you
=))