杭电OJ2006

#include <iostream>
using namespace std;
int a[100005];
int main()
{
	int n;
	while (cin >> n)
	{
		for (int i = 0; i < n; i++)
			cin >> a[i];
		int s = 1;
		for (int j = 0; j < n; j++)
		{
			if (a[j] % 2 != 0)
				s = s*a[j];
		}
		cout << s << endl;
	}
}

猜你喜欢

转载自blog.csdn.net/weixin_42265486/article/details/83506404