Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- //Zad10
- using namespace std;
- float a, b, c;
- float OBWOD_TROJKATA(float a, float b, float c)
- {
- if(a<1 || b<1 || c<1 || a>=b+c || b>=a+c || c>=a+b)
- {
- return -1;
- }
- else
- {
- return a+b+c;
- }
- }
- int main()
- {
- cout << "Podaj dlugosci trzech bokow trojkata: " << endl;
- cin >> a >> b >> c;
- cout << endl;
- if (OBWOD_TROJKATA(a, b, c)== -1)
- {
- cout << "Nie da sie stworzyc takiego trojkata!" << endl;
- }
- else
- {
- cout << "Obwod tego trojkata wynosi: " <<OBWOD_TROJKATA(a, b, c) << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment