SHARE
TWEET

Untitled

a guest May 25th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top