Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int pow(int a, int b)
- {
- int result = a;
- while (b != 1)
- {
- result *= a;
- b--;
- }
- return result;
- }
- unsigned long long int createInterestingNum(int n)
- {
- if (n == 1)
- return n;
- unsigned long long int num = createInterestingNum(n - 1);
- int multiplFactor = pow(10, pow(2, n - 1));
- return num * multiplFactor + n * (multiplFactor / 10) + num;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement