program LazarusProject;
var
inputString: string;
numbers: array[1..20] of real;
i, count: integer;
outputString: string;
begin
writeln('Введите 20 действительных чисел, разделенных пробелами:');
readln(inputString);
i := 1;
for var s in inputString.Split([' ']) do
if TryStrToFloat(s, numbers[i]) then
i := i + 1;
if i > 20 then
break;
end;
count := 0;
for i := 1 to 20 do
if numbers[i] > 10 then
count := count + 1;
outputString := 'Количество значений, превышающих 10: ' + IntToStr(count);
writeln(outputString);
readln;
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
program LazarusProject;
var
inputString: string;
numbers: array[1..20] of real;
i, count: integer;
outputString: string;
begin
writeln('Введите 20 действительных чисел, разделенных пробелами:');
readln(inputString);
i := 1;
for var s in inputString.Split([' ']) do
begin
if TryStrToFloat(s, numbers[i]) then
begin
i := i + 1;
if i > 20 then
break;
end;
end;
count := 0;
for i := 1 to 20 do
begin
if numbers[i] > 10 then
count := count + 1;
end;
outputString := 'Количество значений, превышающих 10: ' + IntToStr(count);
writeln(outputString);
readln;
end.