Паскаль АВС:
Program Greenpigs;
uses crt;
var
Lmile, Wmile, Lyard, Wyard, Lfoot, Wfoot, Linch, Winch, Lline, Wline:integer;
begin
writeln('Введите длину:');
writeln('Мили, ярды, футы, дюймы, линии:');
repeat
readln (Lmile, Lyard, Lfoot, Linch, Lline);
until ((Lmile>=0)and(Lmile<=10000)and(Lyard>=0)and(Lyard<1760)and(Lfoot>=0)and(Lfoot<3)and(Linch>=0)and(Linch<12)and(Lline>=0)and(Lline<12));<br> writeln('Введите ширину:');
writeln('Мили, ярды, футы, дюймы, линии:');
repeat
readln (Wmile, Wyard, Wfoot, Winch, Wline);
until ((Wmile>=0)and(Wmile<=10000)and(Wyard>=0)and(Wyard<1760)and(Wfoot>=0)and(Wfoot<3)and(Winch>=0)and(Winch<12)and(Wline>=0)and(Wline<12));<br> Lmile:=2*(Lmile+Wmile);
Lyard:=2*(Lyard+Wyard);
Lfoot:=2*(Lfoot+Wfoot);
Linch:=2*(Linch+Winch);
Lline:=2*(Lline+Wline);
while (Lline>=12) do
begin
Lline:=Lline-12;
Linch:=Linch+1;
end;
while (Linch>=12) do
begin
Linch:=Linch-12;
Lfoot:=Lfoot+1;
end;
while (Lfoot>=3) do
begin
Lfoot:=Lfoot-3;
Lyard:=Lyard+1;
end;
while (Lyard>=1760) do
begin
Lyard:=Lyard-1760;
Lmile:=Lmile+1
end;
writeln('Периметр равен ',Lmile,' мл. ',Lyard,' ярд. ',Lfoot,' фт. ',Linch,' дюйм. ',Lline,' лн. ');
end.