#include<iostream> //预操作
#include<cmath>
using namespace std;// 使用命名空间std
void min(int &c, int &d)
{
if (c > d)
{
cout << d << " " << c << endl;
}
else if (c < d);
{
cout << c << " " << d << endl;
}
if(c==d)
{
cout << "The two numbers are equal" << endl;
}
}
int main()
{
int a,b;
cout << "Please printf two numbers:" << endl;
cin >> a >> b;
cout << "Two numbers from small to large order is:"<<" ";
min(a, b);
system("pause");
return 0;
}
C++:输入两个整数,将它们按从小到大的顺序输出(使用变量的引用)
最新推荐文章于 2023-10-18 13:37:35 发布