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){
- if(a>b && a>c){
- return a;
- }
- else if (b>a && b>c){
- return b;
- }
- else if (c>a && c>b){
- return c;
- }
- }
- int main()
- {
- cout << max(5,6,7) << endl;
- cout << max(10,12,14) << endl;
- cout << "Podaj trzy liczby" << endl;
- cin >> a;
- cin >> b;
- cin >> c;
- cout << endl << "Najwieksza liczba to: " << max(a,b,c) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement