Cho N và dãy a1,a2,…,aN.hãy đếm số lượng số lẻ trong dãy số lẻ
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Hãy giúp đỡ người khác giải quyết rắc rối, và rắc rối của bạn sẽ biến mất.
#include
using namespace std;
int main()
{
int n, a[101],dem(0);
cout<<"nhap n=";
cin>>n;
cout<<"nhap cac so a="<
for(int i=1;i<=n;i=i+1)
cin>>a[i];
for(int i=1;i<=n;i++)
if(a[i]%2==1)
{
a[i]++;
dem++;
}
cout<<"co "<
return 0;
}