Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. struct punkt *UtworzNowa(struct punkt *punkty, int *rozmiar, int parametr) {
  2. struct punkt *nowaTablica;
  3. int i=0, ilosc = 0;
  4. for (i=0; i<10; i++){
  5. if (sqrt((punkty[i].x)*(punkty[i].x) + (punkty[i].y)*(punkty[i].y))<parametr)
  6. ilosc++;
  7. }
  8. nowaTablica = malloc(ilosc * sizeof(struct punkt));
  9. *rozmiar = ilosc;
  10. for (i=0; i<ilosc; i++) {
  11. if (sqrt((punkty[i].x)*(punkty[i].x) + (punkty[i].y)*(punkty[i].y))<parametr) {
  12. nowaTablica[i].x = punkty[i].x;
  13. nowaTablica[i].y = punkty[i].y;
  14. }
  15. }
  16. return nowaTablica;
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement