编写内联函数Min(float x, float y)来求两个数的较小值。
#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;
}