Răspuns:
#include<iostream>
using namespace std;
int main()
{
int nr, p=0, i=0;
cout<<"nr=" ;cin>>nr;
while(nr!=0)
{if(nr%2==0)
p=p+1;
else
i=i+1;
cout<<"nr=" ;cin>>nr;
}
if(p!=0)
cout<<"S-au introdus "<<p<<" numere pare. "<<endl;
if(i!=0)
cout<<"S-au introdus "<<i<<" numere impare";
return 0;
}