Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- #include<string.h>
- using namespace std;
- int main(int argc, char const *argv[])
- {
- double x[3] , a=0, b=0, c=0, a2=0, b2=0, c2=0;
- int i=0, j=0;
- cin>>x[0]>>x[1]>>x[2];
- sort(x,x+3);
- a=x[2];
- b=x[1];
- c=x[0];
- a2=pow(a,2.0);
- b2=pow(b,2.0);
- c2=pow(c,2.0);
- if(a>=(b+c)){
- for(i=0;i<1;i++){
- cout<<"NAO FORMA TRIANGULO"<<endl;
- }
- }
- else{
- for(j=0;j<1;j++){
- if(a2==(b2+c2)){
- cout<<"TRIANGULO RETANGULO"<<endl;
- }
- if(a2>(b2+c2)){
- cout<<"TRIANGULO OBTUSANGULO"<<endl;
- }
- if(a2<(b2+c2)){
- cout<<"TRIANGULO ACUTANGULO"<<endl;
- }
- if(a==b && b==c){
- cout<<"TRIANGULO EQUILATERO"<<endl;
- }
- if(a==b && b!=c){
- cout<<"TRIANGULO ISOSCELES"<<endl;
- }
- if(a==c && b!=c ){
- cout<<"TRIANGULO ISOSCELES"<<endl;
- }
- if(b==c && c!=a ){
- cout<<"TRIANGULO ISOSCELES"<<endl;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement