Advertisement
sellmmaahh

Zad2

Aug 12th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int broj_elementa_po_velicini(float* niz, int vel, float broj)
  4. {
  5.     int i, clan_niza = 0, broj_vecih = 1;
  6.    
  7.     for(i = 0; i < vel; i++)
  8.     {
  9.         if (broj == niz[i])
  10.         {
  11.             clan_niza = 1;
  12.             break;
  13.         }
  14.     }
  15.    
  16.     if (clan_niza == 0) return -1;
  17.    
  18.     for(i = 0; i < vel; i++)
  19.     {
  20.         if (niz[i] > broj) broj_vecih++;
  21.     }
  22.    
  23.     return broj_vecih;
  24. }
  25.  
  26. int main()
  27. {
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement