这些是我程序的要求。编写一个程序,将找到两个整数和三个整数的最小值,最大值和和。最小,最大和总和各使用1个重载函数。我已经完成了大部分工作,但是不知道如何添加重载函数。这是我的代码
#include <iostream>
using namespace std;
int main(){
int num1, num2;
cout<<"Enter first number: ";
cin>>num1;
cout<<"Enter second number: ";
cin>>num2;
cout<<"Sum of " << num1<< " and " <<num2<<" is: "<<(num1+num2)<<endl;
if (num1>num2)
{
cout << "The max is " << num1<< " and the min is " << num2<< endl;
}
else
{
cout<< num2 << " is the max, and " <<num1 <<" is the min"<<endl;
}
return 0;
}