C语言代码:比较三个整数的大小
#include <stdio.h>
int main() {
int a, b, c;
printf('请输入三个整数:\n');
scanf('%d %d %d', &a, &b, &c);
if (a > b && a > c) {
printf('%d 最大\n', a);
} else if (b > a && b > c) {
printf('%d 最大\n', b);
} else {
printf('%d 最大\n', c);
}
return 0;
}
这段代码首先接受用户输入的三个整数,然后通过 if-else 语句判断出最大的数,并输出结果。
原文地址: https://www.cveoy.top/t/topic/o5iA 著作权归作者所有。请勿转载和采集!