C语言求三个整数的最大值 - 代码示例
#include <stdio.h>
int max(int a, int b, int c) { int max = a; if (b > max) { max = b; } if (c > max) { max = c; } return max; }
int main() { int a, b, c; printf('请输入三个整数:'); scanf('%d %d %d', &a, &b, &c); int maxValue = max(a, b, c); printf('最大值为:%d\n', maxValue); return 0; }
原文地址: https://www.cveoy.top/t/topic/hsS2 著作权归作者所有。请勿转载和采集!