Răspuns:
#include <iostream>
using namespace std;
int main()
{
int n,si=0,sp=0;
cout<<"n= ";
cin>>n;
if(n>=1000&&n<10000)
while(n!=0)
if(n%2==0)
sp+=n%10;
else
si+=n%10;
n/=10;
}
cout<<sp<<' '<<si;
return 0;