Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int oglindit(int n, int k) {
- int z = 0;
- while (n) {
- if (n % 10 != k)
- z = (z * 10) + (n % 10);
- n /= 10;
- }
- return z;
- }
- int main() {
- int n, k, x;
- ifstream f("tipl.in");
- ofstream g("tipl.out");
- f >> n >> k;
- x = oglindit(oglindit(n, k), k);
- g << x << endl;
- x = k;
- while (k * x < n)
- k *= x;
- g << k;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement