HDU2006 求奇数的乘积
#include <iostream>
using namespace std;
int main()
{
int n;
while(cin >> n)
{
int result = 1;
while(n--)
{
int x;
cin >> x;
if(x % 2 == 1)
{
result *= x;
}
}
cout << result <<endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int n;
while(cin >> n)
{
int result = 1;
while(n--)
{
int x;
cin >> x;
if(x % 2 == 1)
{
result *= x;
}
}
cout << result <<endl;
}
return 0;
}