I
I
Igor Prishchepa2014-04-23 20:13:02
HTML
Igor Prishchepa, 2014-04-23 20:13:02

Free Pascal. How to enter numbers without knowing their number?

Hello!
I can’t find any information on how to read numbers separated from each other by an arbitrary number of spaces and newlines.

var n: integer;
...
while not seekeof do
begin
   read(n);
   ...
end;

Doesn't work, error 201. Please help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IAmDanilka, 2014-05-01
@IAmDanilka

Everything is extremely simple:

program sample;
    var a, b, c: integer; //В этом примере три числа, все целые
begin
    readln(a, b, c);
    {сюда можно ещё что-то написать, например, вывод суммы введённых чисел}
    readln;
end;

If something is not clear, does not work or does not work properly - write :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question