#include<iostream>
using namespace std;
int recursion(int);
void main()
{
	int n; 
	cout<<"Please input an integer:"<<endl;//输出提示语
	cin>>n;
	cout<<"before exchange:"<<endl<<n<<endl;//调用递归函数前的n值
	cout<<"after exchange:"<<endl;
	cout<<recursion(n)<<endl;//输出调用递归函数后的n值
}  
int recursion(int n)
{ 
	int r; 
	if(n/10==0)
		return n%10; 
	cout<<n%10; 
	r=recursion(n/10); 
	return(r); 
}