program podriad_idu_na_0;
var
n, x, k, k2:integer;
f:boolean;
begin
read(x);
f:=false;
repeat
if (f=false) and (x mod 10=0) then
f:=true;
k:=k+1;
end
else
if (x mod 10=0) then
k:=k+1
if k>k2 then
k2:=k;
k:=0;
end;
until x=0;
write(k2);
readln;
end.
program proverka_na_ubivanie;
x,t:integer;
t:=x mod 10;
x:=x div 10;
while (x > 0) and ( t<x mod 10) do
if x=0 then
write('Да')
write('Нет')
program chisla_princip_piki_jami;
x,p:integer;
if x>10 then
if (x mod 10)>(x div 10 mod 10) then
p:=1
if (x mod 10)<(x div 10 mod 10) then
p:=0
else f:=true;
while (x>10)and(f=false)
do
if ((x mod 10)>(x div 10 mod 10) )and(p=0)then
if ((x mod 10)<(x div 10 mod 10) )and(p=1)then
x:=x mod 10;
if f=true then write('Нет')
else write('Да')
write('Слишком маленькое число')
program podriad_idu_na_0;
var
n, x, k, k2:integer;
f:boolean;
begin
read(x);
f:=false;
repeat
if (f=false) and (x mod 10=0) then
begin
f:=true;
k:=k+1;
end
else
if (x mod 10=0) then
k:=k+1
else
begin
if k>k2 then
k2:=k;
k:=0;
f:=false;
end;
read(x);
until x=0;
write(k2);
readln;
end.
program proverka_na_ubivanie;
var
x,t:integer;
begin
read(x);
t:=x mod 10;
x:=x div 10;
while (x > 0) and ( t<x mod 10) do
x:=x div 10;
if x=0 then
write('Да')
else
write('Нет')
end.
program chisla_princip_piki_jami;
var
x,p:integer;
f:boolean;
begin
read(x);
f:=false;
if x>10 then
begin
if (x mod 10)>(x div 10 mod 10) then
p:=1
else
if (x mod 10)<(x div 10 mod 10) then
p:=0
else f:=true;
x:=x div 10;
while (x>10)and(f=false)
do
begin
if ((x mod 10)>(x div 10 mod 10) )and(p=0)then
p:=1
else
if ((x mod 10)<(x div 10 mod 10) )and(p=1)then
p:=0
else f:=true;
x:=x mod 10;
end;
if f=true then write('Нет')
else write('Да')
end
else
write('Слишком маленькое число')
end.