Răspuns :
COROANA TE ROG!!!
1.
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
if(n==0||n==1){
cout<<"NU";
return 0;
}
do{
if(n%10>1){
int k=2;
for(int d=2;d<=n%10/2;d++)
if(n%10%d==0)
k++;
if(k==2){
cout<<"DA";
return 0;
}
}
n/=10;
}while(n!=0);
cout<<"NU";
return 0;
}
2.
#include<iostream>
using namespace std;
int main(){
int n,s=0;
cin>>n;
do{
s+=n%10;
n/=10;
}while(n!=0);
if(s<=1){
cout<<"NU";
return 0;
}
for(int d=2;d<=s/2;d++)
if(s%d==0){
cout<<"NU";
return 0;
}
cout<<"DA";
return 0;
}
3.
#include<iostream>
using namespace std;
int main(){
int n,min=10,nn,k=0;
cin>>n;
nn=n;
do{
if(min>nn%10)
min=nn%10;
nn/=10;
}while(nn!=0);
cout<<min<<' ';
do{
if(n%10==min)
k++;
n/=10;
}while(n!=0);
cout<<k;
return 0;
}
4.
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int n;
cin>>n;
if(n<=9){
cout<<"DA";
return 0;
}
if((int)floor(log10(n)+1)%2==1)
if(n%11==n%10){
cout<<"DA";
return 0;
}
else
cout<<"NU";
else
if(n%11==0){
cout<<"DA";
return 0;
}
else
cout<<"NU";
return 0;
}
5.
#include<iostream>
using namespace std;
int main(){
int n,nn=0,p=1;
cin>>n;
if(n==0){
cout<<n;
return 0;
}
do{
if(n%10==0)
nn=nn+(n%10)*p;
else
nn=nn+((n%10)-1)*p;
n/=10;
p*=10;
}while(n!=0);
cout<<nn;
}