
该程序获取 3 个数字并找出其中最大的一个。为此,我们将相互比较数字并找出最大的
Input: a=2,b=4,c=7 Output:7 Largest Number
该程序仅使用 if 语句来查找最大数。
#include <iostream>
using namespace std;
int main() {
int a,b,c;
a=2,b=4,c=7;
if(a>b) {
if(a>c) {
printf("%d Largest Number ",a);
} else {
printf("%d Largest Number ",c);
}
} else {
if(b>c) {
printf("%d Largest Number ",b);
} else {
printf("%d Largest Number ",c);
}
}
return 0;
}以上就是C程序:找出三个数中的最大数的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号