pascalabcnet/InstallerSamples/!Tutorial/06_ForWhileRepeat/For9.pas
2025-10-14 21:21:47 +03:00

22 lines
464 B
ObjectPascal
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Цикл for. Поиск значения. Оператор break
const n = 10;
begin
var k := ReadInteger('Введите число для поиска:');
Println('Введите', n, 'чисел');
var found := False;
for var i := 1 to n do
begin
var x := ReadInteger;
if x = k then
begin
found := True;
break;
end;
end;
if found then
Println('Найдено')
else Println('Не найдено');
end.