Skip to content

Instantly share code, notes, and snippets.

@mbledkowski
Last active March 23, 2022 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbledkowski/8cb7702519c0fb050ef4eb7468ca0810 to your computer and use it in GitHub Desktop.
Save mbledkowski/8cb7702519c0fb050ef4eb7468ca0810 to your computer and use it in GitHub Desktop.
my siorka's homework
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a;
cout<<"Podaj a: ";
cin>>a;
int b;
cout<<"Podaj b: ";
cin>>b;
int c;
cout<<"Podaj c: ";
cin>>c;
if(a<=0 || b<=0 || c<=0) {
cout<<"Brak rozwiazania";
} else if(pow(c,2)==pow(a,2)+pow(b,2)) {
cout<<"Trojkat jest prostokatny";
} else {
cout<<"Trojkat nie jest prostokatny";
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment