Проверено в турбопаскаль 7
var ost,n:longint;
i,kvadrat, udvsumma:integer;
numbers:array[1..10] of integer;
begin
writeln('-------------------------------------');
write('input n:');
readln(n);
writeln('vi vveli:',n);
ost:=n;
i:=0;
while (ost>0) do
begin
i:=i+1;
numbers[i]:=ost mod 10;
ost:=ost div 10;
end;
if(i<3) then<br>begin
writeln('Obman!!! Nado vvesti minimum 3 znaka chislo');
end
else
begin
kvadrat:=numbers[i]*numbers[i];
udvsumma:=2*(numbers[1]+numbers[2]);
writeln('kvadrat pervogo=', kvadrat);
writeln('udvoennaya summa poslednih=', udvsumma);
if(udvsummawriteln('Vse verno, udvoennaya summa menshe')
else
writeln('ne verno, udvoennaya summa ne menshe');
end;
writeln('press enter');
readln;
end.