Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- #include <cmath>
- using namespace std;
- double a,b,c;
- int main()
- {
- cout<<"Podaj dlugosc pierwszego odcinku"<<endl;
- cin>>a;
- cout<<"Podaj dlugosc drugiego odcinku"<<endl;
- cin>>b;
- cout<<"Podaj dlugosc trzeciego odcinku"<<endl;
- cin>>c;
- if( a < b+c and b < a+c and c< a+b)
- {
- cout<<"Z podanych odcinkow mozna zbudowac trojkat";
- if( a == b == c)
- {
- cout<<" rownoboczny"<<endl;
- }
- else if ( a == b and a!= c or a == c and c!= b or b == c and b!= a)
- {
- cout<<" rownoramienny"<<endl;
- if ( pow(a,2)==pow(b,2)+pow(c,2) or pow(b,2)==pow(a,2)+pow(c,2)
- or pow(c,2)==pow(a,2)+pow(b,2)) cout<<"bedacy jednoczesnie prostokatnym"<<endl;
- }
- else if ( a*a==b*b+c*c or b*b==a*a+c*c or c*c==a*a+b*b )
- {
- cout<<" prostokatny"<<endl;
- }
- else if (a != b and a != c and b != c)
- {
- cout<<" roznoboczny"<<endl;
- }
- }
- else cout<<"Z danych odcinkow nie można zbudowac trojkata"<<endl;
- system("pause");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement