Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- struct Tacka {
- int x,y;
- };
- struct Trougao {
- struct Tacka A,B,C;
- };
- void izbaci_pravougle (struct Trougao* Trouglovi, int vel)
- {
- int i, pravougli=0;
- struct Trougao* p = Trouglovi;
- int a, b, c;
- 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));
- 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));
- 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));
- if(((a*a+b*b)==c*c) || ((a*a+c*c)==b*b) || ((b*b+c*c)==a*a)) pravougli=1;
- for(i=0; i<vel-1; i++) {
- if(pravougli==1) {
- *p=*(p+1);
- vel--;
- }
- p++;
- }
- }
- int main()
- {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement