Answer the question
In order to leave comments, you need to log in
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;
Answer the question
In order to leave comments, you need to log in
Everything is extremely simple:
program sample;
var a, b, c: integer; //В этом примере три числа, все целые
begin
readln(a, b, c);
{сюда можно ещё что-то написать, например, вывод суммы введённых чисел}
readln;
end;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question