What's wrong with my code? (Pascal)
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.
Re: What's wrong with my code? (Pascal)
Послано
Zteeks 18 дек 2016 03:27
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)
AC now, thank you
Re: What's wrong with my code? (Pascal)
Послано
Zteeks 20 дек 2016 02:59
=))