Advertisement
Guest User

Untitled

a guest
May 3rd, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. function [ pole, obw ] = Trojkat( a,b,c )
  2.  
  3. if(( a<0 || b<0 || c<0))
  4. disp('Ujemny bok');
  5. pole = 0;
  6. obw = 0;
  7. return;
  8. else
  9. if((a*b>c && b*c>a && a*c>b))
  10. obw = a+b+c;
  11. disp(obw);
  12. %połowa obwodu
  13. p = obw/2;
  14. pole = sqrt(p*(p-a)*(p-b)*(p-c));
  15. else
  16. pole=0;
  17. obw=0;
  18. disp('To nie trójkąt');
  19. end
  20. end
  21.  
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement