有没有办法让我完成这项工作?还是我需要使用单独的文件?
#include <iostream> // Necessary
using namespace std;
#define long double mMaxOf2(long double min, long double max)
#define long double mMaxOf3(long double Min, long double Max, long double Mid)\
{\
mMaxOf2(mMaxOf2((Min), (Mid), (Max)));\
}
int main()
{
double primary;
double secondary;
double tertiary;
cout << "Please enter three numbers: ";
cin >> primary >> secondary >> tertiary;
cout << "The maximum of " << primary << " " << secondary << " " << tertiary;
cout << " using mMaxOf3 is " << (mMaxOf3(primary, secondary, tertiary));
return 0;
}
问题在于 mMaxOf3,它没有被声明……嗯,也许我需要原型。