View Code of Problem 68

#include<iostream>
using namespace std;

int max(int a,int b,int c)
{
//return a > b ? (a > c ? a : c) : (b > c ? b : c);
return a>b?(a>c?a:c):(b>c?b:c);	//若>不成立,表示<= 
} 
 
int main()
{   
    int a,b,c;
	cin>>a>>b>>c;
	cout<<max(a,b,c);
	return 0;
}

Double click to view unformatted code.


Back to problem 68