Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdio>
- using namespace std;
- int main (){
- int li1,li2,li3=0,wys1,wys2,max;
- system("cls");
- do{
- cout << "Podaj pierwsza liczbe: ";cin>>li1;
- cout << "Podaj druga liczbe: ";cin>>li2;
- cout << "Podaj trzecia liczbe: ";cin>>li3;}while((li1<0)||(li2<0)||(li3<0));
- max=li1;
- wys1=li2;wys2=li3;
- if (max<li2){max=li2;wys1=li1;wys2=li3;}
- if (max<li3){max=li3;wys1=li1;wys2=li2;}
- cout<<"Boki ktore podales to: "<<li1<<", "<<li2<<", "<<li3<<" i ";
- if ((wys1+wys2)>max) cout<<"mozna skonstruowac z nich trojkat\n"; else cout <<"nie mozna skonstruowac z nich trojkata\n";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment