#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++:输入两个整数,将它们按从小到大的顺序输出(使用变量的引用)
最新推荐文章于 2024-05-23 17:21:25 发布
本文介绍了一个简单的C++程序,该程序通过用户输入两个整数并输出这两个数从小到大的顺序。此外,程序还考虑了两个数相等的情况。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
Stable-Diffusion-3.5
图片生成
Stable-Diffusion
Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率
2万+

被折叠的 条评论
为什么被折叠?



