Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- double a, b, c, vid, poluperimetr, S;
- cin>>a>>b>>c;
- if(a*a<b*b+c*c||b*b<a*a+c*c||c*c<a*a+b*b){
- if(a==b&&b==c)
- {
- vid=1;
- }else{
- if(a==b||b==c||c==a)
- {
- vid=2;
- }else{
- vid=3;}}
- poluperimetr=(a+b+c)/2;
- S=sqrt(poluperimetr*(poluperimetr-a)*(poluperimetr-b)*(poluperimetr-c));
- cout<<S<<" "<<vid;
- }else{cout<<"-1";}
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment