#include <iostream>
int main()
{
int value1 = 1, value2 = 10;
std::cout << "Min = " << std::min(value1,value2) <<std::endl;
std::cout << "Max = " << std::max(value1,value2)<< std::endl;
}
Run Code Online (Sandbox Code Playgroud)
据我所知,min和max函数的定义<algorithm>.
如果我没有告诉预处理器包含<algorithm>为什么代码仍然有效?