Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by Nicholas_Arsa ( 5 years ago )
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int S1,S2,S3,a,b,c;
    cout << "masukkan sisi pertama: ";cin>>S1;
    cout << "masukkan sisi kedua: ";cin>>S2;
    cout << "masukkan sisi ketiga: ";cin>>S3;

    a=S1;b=S2;c=S3;
    if(S1<S2){
            a=S2;
            b=S1;
            c=S3;
    }else if(S1<S3){
            a=S3;
            b=S1;
            c=S2;
    }

    if(a>=b+c)cout<<"Bukan segitiga";
    else if(pow(a,2)==pow(b,2)+pow(c,2))cout<<"Segitiga siku-siku";
    else if(pow(a,2)>pow(b,2)+pow(c,2))cout<<"Segitiga tumpul";
    else if(pow(a,2)<pow(b,2)+pow(c,2))cout<<"Segitiga lancip";

    return 0;
}

 

Revise this Paste

Parent: 119602
Your Name: Code Language: