Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MODULE Bcycle10;
- IMPORT In, Out;
- VAR N, a, b, x, frst, sum, counter: INTEGER;
- BEGIN
- Out.String ('Введите натуральное число: '); In.Int(N);
- frst := N MOD 10;
- a := N;
- counter := 1;
- WHILE a > 1 DO a := a DIV 10;
- counter := counter * 10;
- END;
- sum := counter;
- WHILE N > 1 DO N := N DIV 10;
- x := N MOD 10; (* вторая и далее цифры наоборот *)
- sum := sum DIV 10;
- b := b + x * sum;
- END;
- sum := frst * counter + b;
- Out.Int(sum,3);Out.Ln;
- END Bcycle10.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement