Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- struct Kompleksni
- {
- double re, im;
- };
- int funkcija(struct Kompleksni niz[], int velicina)
- {
- int i,j, brojac=0;
- for (i=0; i<velicina; i++)
- {
- for (j=0; j<velicina; j++)
- {
- if ((niz[i].re == niz[j].re) && (niz[i].im == (-1)*niz[j].im) )
- brojac++;
- }
- }
- return brojac;
- }
- int main()
- {
- struct Kompleksni niz[5] = {{1,2}, {1,0}, {2,3}, {2,4},{2,2}};;
- int i,j,broj, vel = 5;
- for (i = 0; i<5; i++)
- broj = funkcija(niz, vel);
- printf("Broj je %d ", broj);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment