Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a,b,c;
- int max(int a,int b, int c)
- {
- int d=a+b+c;
- while(d>a && d>b && d>c)
- {d=d-1;}
- return d;
- }
- int main()
- {
- cout<<"Podaj trzy liczby naturalne"<<endl;
- cin>>a;
- cin>>b;
- cin>>c;
- cout<<"najwieksza liczba to "<< max(a,b,c);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement