http://acm.hdu.edu.cn/showproblem.php?pid=2006
1 #include<iostream> 2 #include<stdio.h> 3 #include<math.h> 4 #include<queue> 5 #include<stack> 6 #include<algorithm> 7 #define PI 3.1415927 8 using namespace std; 9 10 int main() 11 { 12 int a[20],n,i,sum; 13 while(~scanf("%d",&n)) 14 { 15 sum=1; 16 for(i=0;i<n;i++) 17 { 18 scanf("%d",&a[i]); 19 if(a[i]%2!=0) 20 { 21 sum*=a[i]; 22 } 23 } 24 printf("%d\n",sum); 25 } 26 27 return 0; 28 }
时间: 2024-10-12 11:48:21