#include <stdio.h>
int main()
{int n,i,num,s=1;scanf("%d",&n);for (i=1;i<=n;i++){scanf("%d",&num);if(num%2!=0){s*=num;}}printf("%d",s);return 0;
}
详细解决方案
【1340】奇数的乘积
热度:13 发布时间:2023-12-06 10:00:58.0
#include <stdio.h>
int main()
{int n,i,num,s=1;scanf("%d",&n);for (i=1;i<=n;i++){scanf("%d",&num);if(num%2!=0){s*=num;}}printf("%d",s);return 0;
}