Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int f(int n){
- int b = n, a = n,sum = 0;
- int cnt = 0;
- while(b != 0){
- b = b / 10;
- cnt++;
- }
- int i = cnt - 1;
- while(a != 0){
- sum = sum + (a % 10) * bpow(10, i);
- a = a / 10;
- i--;
- }
- if(sum + n == k)
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement