所以我让这个程序运行,但现在我输入的任何数字都变成了非常大的数字。我需要为数学计算添加标题吗?还是有类似 C 的东西,C++ 的 printf 函数?
#include <iostream> // Necessary
using namespace std;
#define mMaxOf2(max, min) ((max) > (min) ? (max) : (min))
#define mMaxOf3(Min, Mid, Max)\
{\
mMaxOf2(mMaxOf2((Min), (Mid)),(Max))\
}
int main()
{
double primary;
double secondary;
double tertiary;
long double maximum = mMaxOf3(primary, secondary, tertiary);
cout << "Please enter three numbers: ";
cin >> primary >> secondary >> tertiary;
cout << "The maximum of " << primary << " " << secondary << " " << tertiary;
cout << " using mMaxOf3 is " << maximum;
return 0;
}