Advertisement
_mh007

Untitled

Feb 15th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. struct Tacka {
  5. int x,y;
  6. };
  7. struct Trougao {
  8. struct Tacka A,B,C;
  9. };
  10.  
  11. void izbaci_pravougle (struct Trougao* Trouglovi, int vel)
  12. {
  13. int i, pravougli=0;
  14. struct Trougao* p = Trouglovi;
  15. int a, b, c;
  16. a=sqrt(((*p).A.y-(*p).B.y)*((*p).A.y-(*p).B.y)+((*p).A.x-(*p).B.x)*((*p).A.x-(*p).B.x));
  17. b=sqrt(((*p).A.y-(*p).C.y)*((*p).A.y-(*p).C.y)+((*p).A.x-(*p).C.x)*((*p).A.x-(*p).C.x));
  18. c=sqrt(((*p).C.y-(*p).B.y)*((*p).C.y-(*p).B.y)+((*p).C.x-(*p).B.x)*((*p).C.x-(*p).B.x));
  19. if(((a*a+b*b)==c*c) || ((a*a+c*c)==b*b) || ((b*b+c*c)==a*a)) pravougli=1;
  20. for(i=0; i<vel-1; i++) {
  21. if(pravougli==1) {
  22. *p=*(p+1);
  23. vel--;
  24. }
  25. p++;
  26. }
  27. }
  28.  
  29.  
  30. int main()
  31. {
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement