#include "stdio.h" int main(void){ int i, j, num; int OddSum = 1; while(scanf("%d", &j) != EOF){ for(i=0; i<j; i++){ scanf("%d", &num); if(num % 2 != 0){ OddSum *= num; } } printf("%d\n", OddSum); OddSum = 1; } return 0; }
时间: 2024-09-16 06:33:08
#include "stdio.h" int main(void){ int i, j, num; int OddSum = 1; while(scanf("%d", &j) != EOF){ for(i=0; i<j; i++){ scanf("%d", &num); if(num % 2 != 0){ OddSum *= num; } } printf("%d\n", OddSum); OddSum = 1; } return 0; }