标签:++ hdu code cin main src ace sum ima
思路:输入数据,判断奇数偶数,然后计算奇数乘积。
代码:
#include<iostream> using namespace std; int main() { int n; int num, sum; while (cin >> n) { sum = 1; for (int i = 0; i < n; i++) { cin >> num; if (num % 2 != 0) { sum *= num; } } cout << sum << endl; } system("pause"); return 0; }
标签:++ hdu code cin main src ace sum ima
原文地址:https://www.cnblogs.com/pcdl/p/12250358.html