Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- int n, i, x, proizvod = 1;
- int flag = 0;
- if (!scanf("%d", &n) || n < 0) {
- puts("-1");
- return 0;
- }
- for (i = 0; i < n; i++) {
- scanf("%d", &x);
- if (abs(x) & 1 && x < 0) {
- proizvod *= x;
- flag = 1;
- }
- }
- if (!flag) puts("Nema neparnih i negativnih brojeva");
- else printf("%d\n", proizvod);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement