Advertisement
Lukasz_Miskiewicz

Zadanie 13

Mar 31st, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int a,b,c;
  4.  
  5. int max(int a,int b, int c)
  6. {
  7. int d=a+b+c;
  8. while(d>a && d>b && d>c)
  9. {d=d-1;}
  10. return d;
  11. }
  12.  
  13. int main()
  14. {
  15. cout<<"Podaj trzy liczby naturalne"<<endl;
  16. cin>>a;
  17. cin>>b;
  18. cin>>c;
  19. cout<<"najwieksza liczba to "<< max(a,b,c);
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement