Var a,a1,a2,a3,a4,a5,a6,b:integer; begin write('a = '); readln(a); a1:=a div 100000; a2:=a div 10000 mod 10; a3:=a mod 10000 div 1000; a4:=a mod 1000 div 100; a5:=a mod 100 div 10; a6:=a mod 10; b:=a2*100000+a1*10000+a4*1000+a3*100+a6*10+a5; writeln('b = ',b); end.
begin
write('a = ');
readln(a);
a1:=a div 100000;
a2:=a div 10000 mod 10;
a3:=a mod 10000 div 1000;
a4:=a mod 1000 div 100;
a5:=a mod 100 div 10;
a6:=a mod 10;
b:=a2*100000+a1*10000+a4*1000+a3*100+a6*10+a5;
writeln('b = ',b);
end.
Пример:
a = 123456
b = 214365