Răspuns:
#include <iostream>
using namespace std;
int main() {
int a,copie,ninv=0,prim1=1,prim2=1,i=2;
cin >> a;
while(copie!=0) {
ninv*=10+copie%10;
copie/=10;
}
while(i<=a/2) {
if(a%i==0)
prim1=0;
i++;
}
while(i<=ninv/2) {
if(ninv%i==0)
prim2=0;
i++;
}
if(prim1==1 && prim2==1)
cout << "DA";
else cout << "NU";
}
Succes!