the task is: without storage to find the two minimum numbers, sum of whose squares >500. a fragment of my program in Pascal :

how to check the squares? she can not figure out. it is desirable to describe the algorithm in Pascal, or simply to explain the words. thank you in advance.

```
for i:=1 to n do begin
phony (f, a);
if (a<min1) then begin min2:=min1; min1:=a; end;
if (a>min1) and (a<min2) then min2:=a;
end;
```

how to check the squares? she can not figure out. it is desirable to describe the algorithm in Pascal, or simply to explain the words. thank you in advance.

asked March 19th 20 at 08:50

2 answers

answered on March 19th 20 at 08:52

```
begin
writeln(16, 16);
end.
```

answered on March 19th 20 at 08:54

start with 1-Tsy and increase each step by 1.

As soon as you get the sum of > 500 - interrupt cycle.

As soon as you get the sum of > 500 - interrupt cycle.

Find more questions by tags Pascal

Originally you argue! - Kara commented on March 19th 20 at 08:55

Yes... there is "more" is. - Kara commented on March 19th 20 at 08:58