The write function evaluation with a smaller value of the two integers

Write inline function Min (float x, float y) to find the smaller of two numbers.

#include <iostream>  
using namespace std;  
float Min(float a,float b)
{
 return (a<b)?a:b;
}
int main()
{
    float a, b, c;
    cin >> a >> b;
    c = Min(a,b);    
    cout << "Min(" << a << "," << b << ")=" << c << endl;
}
Published 102 original articles · won praise 93 · views 4963

Guess you like

Origin blog.csdn.net/huangziguang/article/details/104759116