Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int Razliciti (int *niz, int vel) {
- int i, br_razlicitih=0, ima_ga=0,j;
- for (i=0; i<vel; i++) {
- for (j=i+1; j<vel; j++) {
- if (niz[i]==niz[j])
- {
- ima_ga=1;
- break;
- }}
- if (ima_ga==0) br_razlicitih++;
- ima_ga=0;
- }
- return br_razlicitih;
- }
- int main () {
- int niz[8]={2, 5, 6, 2, 3, 1, 3, 6};
- printf("%d",Razliciti(niz,8));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement