Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [ pole, obw ] = Trojkat( a,b,c )
- if(( a<0 || b<0 || c<0))
- disp('Ujemny bok');
- pole = 0;
- obw = 0;
- return;
- else
- if((a*b>c && b*c>a && a*c>b))
- obw = a+b+c;
- disp(obw);
- %połowa obwodu
- p = obw/2;
- pole = sqrt(p*(p-a)*(p-b)*(p-c));
- else
- pole=0;
- obw=0;
- disp('To nie trójkąt');
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement