#include <iostream>
using namespace std;
int rec(int a, int &b)
{
if(a/10==0)
return a%10;
}
int t=rec(a/10, b);
b*=10;
return t+(a%10) *b;
int main(){
int a, b=1;
cin>>a;
int f = rec(a,b);
cout<<f<<endl;
cout<< f + a;
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int rec(int a, int &b)
{
if(a/10==0)
{
return a%10;
}
int t=rec(a/10, b);
b*=10;
return t+(a%10) *b;
}
int main(){
int a, b=1;
cin>>a;
int f = rec(a,b);
cout<<f<<endl;
cout<< f + a;
return 0;
}