2 / 3
Nov 2016

include

include

using namespace std;
int bok1,bok2,bok3;

int main()
{
cout << "Witaj w programie sprawdzania czy trojkat jest prostokatny" << endl;
cout<<"Podaj krotszy bok: ";
cin>>bok1;
cout<<"Podaj drugi krotszy bok: ";
cin>>bok2;
cout<<"Podaj najdluzszy bok: ";
cin>>bok3;

if  ((bok1*bok1+bok2*bok2=bok3*bok3)||(bok1*bok1+bok3*bok3=bok2*bok2)||(bok2*bok2+bok3*bok3=bok1*bok1))
{
    cout<<"Trojkat jest prostokatny!"<<endl;
}
    else
        {cout<<"Trojkat nie jest prostokatny!"<<endl;
        }
return 0;

}

  • created

    Nov '16
  • last reply

    Aug '17
  • 2

    replies

  • 638

    views

  • 3

    users

What is wrong with your post? :slight_smile:

  • You should note the problem you are trying to solve, minimum is the problem code, better give a hyperlink to the problem desciption
  • You should note which error message you get
  • You should format your code correctly

Without this information it is impossible to help. :cry:

9 months later

I corrected it as best as I could. You have to define all, however. If you don't, I can't help you.

int bok1,bok2,bok3;

void setup() {
using namespace std;

cout << "Witaj w programie sprawdzania czy trojkat jest prostokatny" << endl;
cout<<"Podaj krotszy bok: ";
cin>>bok1;
cout<<"Podaj drugi krotszy bok: ";
cin>>bok2;
cout<<"Podaj najdluzszy bok: ";
cin>>bok3;

if ((bok1*bok1+bok2*bok2=bok3*bok3)||(bok1*bok1+bok3*bok3=bok2*bok2)||(bok2*bok2+bok3*bok3=bok1*bok1))
{
cout<<"Trojkat jest prostokatny!"<<endl;
}
else
{cout<<"Trojkat nie jest prostokatny!"<<endl;
}
return 0;

}

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 35 26d

Want to read more? Browse other topics in C and C++ or view latest topics.