Advertisement
Guest User

Untitled

a guest
May 25th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. struct kraj
  5. {
  6. float powierzchnia;
  7. int ludnosc;
  8. };
  9.  
  10. double zageszczenie(struct kraj tab[],int n)
  11. {
  12. int i=0;
  13. double zageszczenie;
  14. double min=(tab[i+1].ludnosc/tab[i+1].powierzchnia);
  15. for (i=0;i<n;i++)
  16. min=(tab[i+1].ludnosc/tab[i+1].powierzchnia);
  17. if(zageszczenie<min)
  18. {
  19. min=zageszczenie;
  20. }
  21. return min;
  22. }
  23.  
  24. int main()
  25. {
  26. struct kraj kr[3]={{178,320},{102,323},{154,280}};
  27. printf("%2lf",zageszczenie(kr,3));
  28.  
  29.  
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement