Created
March 21, 2016 14:21
-
-
Save drage0/0634a2d0babf88acb18e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program c; | |
var n, m, i: integer; | |
function brf(n: integer; b: boolean): integer; | |
begin | |
if b then brf := 1 | |
else brf := 0; | |
while(n > 0) do begin | |
if(b) then brf := brf * 10 | |
else brf := brf + 1; | |
n := n div 10; | |
end; | |
end; | |
procedure cikld(var n: integer); | |
var x, k: integer; | |
begin | |
k := brf(n, true); | |
x := n mod 10; | |
n := n div 10; | |
n := n + x*(k div 10); | |
end; | |
begin | |
write('n='); | |
readLn(n); | |
writeLn(n); | |
for i:=1 to brf(n, false) do begin | |
cikld(n); | |
writeLn(n); | |
end; | |
readLn(); | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment