#include <iostream>
// return the reverse of a number
int reverse( int number, int reverse_so_far = 0 )
{
if( number < 0 ) return -reverse( -number ) ;
if( number < 10 ) return reverse_so_far*10 + number ;
return reverse( number/10, reverse_so_far*10 + number%10 ) ;
}
int main()
{
// take the integer input from the user
std::cout << "number? " ;
int number ;
std::cin >> number ;
// Reverse the input
constint reverse_number = reverse(number) ;
std::cout << "reverse_number: " << reverse_number << '\n' ;
// Substract the reversal from the original number
constint difference = number - reverse_number ;
std::cout << "difference: " << difference << '\n' ;
// Finally, reverse the resulting number
constint reverse_difference = reverse(difference) ;
std::cout << "reverse_difference: " << reverse_difference << '\n' ;
// Add it to its unreversed form
constint result = difference + reverse_difference ;
// The program will output the final result
std::cout << "result: " << result << '\n' ;
}