Răspuns:
#include<iostream>
using namespace std;
int main()
{ int n, a, b, nc, p=1;
cin>>n;
a=n%10;
nc=n;
while(nc)
{ nc/=10;
p*=10;}
p=p/10;
n=n-n%10+n/p;
n=n%p+a*p;
cout<<n;
return 0;
}
2)
#include<iostream>
using namespace std;
int main()
{ int n, a=0, nr=0, p=1;
cin>>n;
while(n)
{ if(n%2==0)
{a=a+n%10*p;
p=p*10;}
n/=10;
}
for(int i=1;i<=a;i++)
if(a%i==0)
{nr++; cout<<i<<endl;}
cout<<a<<" are "<<nr<<" divizori";
return 0;
}
Explicație: