Программа:
program files;
var f: text;
c: string;
begin
assign(f, 'path/to/file.txt');
reset(f);
while not eof(f)
do begin
readln(f,c);
if(c.Contains('1') or c.Contains('2')
or c.Contains('3') or c.Contains('4')
or c.Contains('5') or c.Contains('6')
or c.Contains('7') or c.Contains('8')
or c.Contains('9'))
then writeln(c);
end;
close(f);
end.
Поделитесь своими знаниями, ответьте на вопрос:
Написать программу, которая считывает текст из файла и выводит на экран предложения, содержащие цифры.
Программа:
program files;
var f: text;
c: string;
begin
assign(f, 'path/to/file.txt');
reset(f);
while not eof(f)
do begin
readln(f,c);
if(c.Contains('1') or c.Contains('2')
or c.Contains('3') or c.Contains('4')
or c.Contains('5') or c.Contains('6')
or c.Contains('7') or c.Contains('8')
or c.Contains('9'))
then writeln(c);
end;
close(f);
end.