Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- struct Kompleksni
- {
- float re, im;
- };
- struct Kompleksni *funkcija(struct Kompleksni niz[], int *velicina)
- {
- int i, max = 0, min = 9, modul;
- for (i=0; i<*velicina; i++)
- {
- modul = sqrt((niz[i].re) * (niz[i].re) + (niz[i].im*niz[i].im));
- if (modul > max)
- max = modul;
- if (modul < min)
- min = modul;
- }
- return max+min;
- }
- int main()
- {
- struct Kompleksni niz[6]={{1,2}, {6,5}, {2,1},{4,5}, {7,1},{2,0}};
- int velicina=6, i;
- struct Kompleksni novi[6];
- struct Kompleksni *pok = novi;
- pok = funkcija(niz, &velicina);
- printf("%d", pok );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment