Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- #include <math.h>
- int funkcija(int *niza, int n) {
- int brojac =0 ;
- for(int i = 0; i < n; i++) {
- if(niza[i] <= 0) {
- brojac++;
- }
- }
- return brojac;
- }
- int main(int argc, char * argv[]) {
- int n;
- scanf("%d", &n);
- int niza[n];
- for(int i= 0; i < n; i++) {
- scanf("%d", &niza[i]);
- }
- int res = funkcija(niza, n);
- printf("%d\n", res);
- }
- /*
- 9
- 1 -7 0 2 -5 0 2 0 4
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement