I find Problem
How can I invert Number like 103 to 301
I am try But Need help
- Code: Select all
program rr;
var y,x:integer;
begin
while y<>0 do
begin
readln(x);
y:= x mod 10;
writeln(y);
end;
x:=x div 10;
readln;
end;
program rr;
var y,x:integer;
begin
while y<>0 do
begin
readln(x);
y:= x mod 10;
writeln(y);
end;
x:=x div 10;
readln;
end;
var
num, revnum, i:integer;
s1, s2: string;
begin
S1:=IntToStr(num);
for I:=Length(S1) downto 1 do
S2:=S2+S1[I]
revnum:=strtoint(s2);
end;
function MirrorNumber(Value: Integer): Integer;
begin
Result := 0;
while Value <> 0 do
begin
Result := Result * 10 + Value mod 10;
Value := Value div 10;
end;
end;
Users browsing this forum: No registered users and 2 guests