Program n1; Uses CRT; Var a,b,c,x: integer; begin ClrScr; Writeln('Vvedite chislo'); Readln(x); a:=x div 100; c:=x mod 10 ; b:=x div 10 mod 10; If a=0 then writeln('chislo ne trehznachnoe!') else writeln(c,b,a); readln end.
2) ИЛИ через string
Program n1; Uses CRT; Var a: string; begin ClrScr; Writeln('Vvedite chislo'); Readln(a); If length(a)>3 then writeln('oshibka') else writeln(a[3],a[2],a[1]); readln end.
Answers & Comments
1)
Program n1;
Uses CRT;
Var a,b,c,x: integer;
begin
ClrScr;
Writeln('Vvedite chislo');
Readln(x);
a:=x div 100;
c:=x mod 10 ;
b:=x div 10 mod 10;
If a=0 then writeln('chislo ne trehznachnoe!') else writeln(c,b,a);
readln
end.
2) ИЛИ через string
Program n1;
Uses CRT;
Var a: string;
begin
ClrScr;
Writeln('Vvedite chislo');
Readln(a);
If length(a)>3 then writeln('oshibka') else
writeln(a[3],a[2],a[1]);
readln
end.