Răspuns :
#include <iostream>
using namespace std;
int main(){
int n, a, c, x=0, p=1;
cin>>n;
while (n) {
c=n%10;
n/=10;
a=c;
c=n%10;
n/=10;
x=x+c*p;
p*=10;
x=x+a*p;
p*=10;
}
cout<<x<<'\n';
}
using namespace std;
int main(){
int n, a, c, x=0, p=1;
cin>>n;
while (n) {
c=n%10;
n/=10;
a=c;
c=n%10;
n/=10;
x=x+c*p;
p*=10;
x=x+a*p;
p*=10;
}
cout<<x<<'\n';
}
#include <iostream>
using namespace std;
int main()
{
int n;
int k=1,i=1;
cin>>n;
int V[999999];
for(int i=1;i<=k;i++)
{
V[i] = n%10;
n = n/10;
if(n!=0)
{
k++;
}
}
for(i=k;i>=1;i=i-2)
{
swap(V[i],V[i-1]);
cout<<V[i]<<V[i-1];
}
}
using namespace std;
int main()
{
int n;
int k=1,i=1;
cin>>n;
int V[999999];
for(int i=1;i<=k;i++)
{
V[i] = n%10;
n = n/10;
if(n!=0)
{
k++;
}
}
for(i=k;i>=1;i=i-2)
{
swap(V[i],V[i-1]);
cout<<V[i]<<V[i-1];
}
}