Răspuns:
#include <iostream>
using namespace std;
int par(int x)
{
if(x==0)
return 1;
while(x)
{
if(x%2==0)
return 1;
x=x/10;
}
return 0;
}
int imp(int y)
{
int s=0;
while(y)
{
s=s+y%10;
y=y/10;
}
if(s%2==1)
return 1;
return 0;
}
int main()
{
int n;
cin>>n;
if(par(n))
cout<<"DA";
else
cout<<"NU";
cout<<endl;
if(imp(n))
cout<<"Suma impara";
else
cout<<"Suma para";
return 0;
}
Explicație: