//PascalABC.NET
begin
readseqinteger('Введите 15 чисел:',15).Where(x -> Odd(x)).Average.Println;
end.
Ответ: Программа делает деление первого на втрого и выводит его остаток
Пример:
<em /><em /><em>1 / 2 = 0 (остаток 1)
</em><em>10 / 5 = 2 (остаток 0)
</em><em>25 / 10 = 2 (остаток 5)</em>
<em>31 / 3 = 10 (остаток 1)</em>
<em>33 / 22 = 1 (остаток 11)</em>
Алгоритм в виде блок-схемы в приложенной картинке
n = int(input())
m = int(input())
ans = 0
for i in range(m, n-1, -1):
buf = 0
for y in str(i)[1:]:
y = int(y)
if y%2==0 and y != 0:
buf += 1
if (y%4==0 and y!=0) or buf >= 2:
ans = i
break
if ans != 0:
print(i)
break
Названия и адреса файлов подгоните сами. Я выделю в коде жирным шрифтом.
uses crt;
var i,o:text;
s:string;
ans:integer;
begin
assign(i,'C:\Pascal\input.txt'); reset(i);
assign(o,'C:\Pascal\output.txt'); rewrite(o);
while eoln(i)<>true do
begin
readln(i,s);
if ((s[2]>s[1]) and (s[3]>s[2]) and (s[4]>s[3])) or ((s[2]<s[1]) and (s[3]<s[2]) and (s[4]<s[3])) then
begin
writeln(o,s);
inc(ans);
end;
end;
writeln(ans);
close(o);
<span>end.</span>