HDOJ_2006_求奇数的乘积
AC代码:
#include <iostream> #include <cstdio> using namespace std; int main(void) { freopen("in.txt","r",stdin); long long a,n; while(scanf("%lld",&n)!=EOF) { long long sum=1; for(long long i=1;i<=n;i++) { scanf("%lld",&a); if(a%2!=0) sum*=a; } printf("%lld\n",sum); } fclose(stdin); return 0; }