1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-30 09:16:20 +00:00
202401-programming-assignments/【实践课外】0.熟悉编程环境/7-4 简单最值.c

22 lines
321 B
C
Raw Normal View History

2024-10-11 10:23:08 +00:00
#include <stdio.h>
int max(int a, int b, int c) {
if (a > b && a > c) {
return a;
} else if (b > a && b > c) {
return b;
} else { // c > a && c > b
return c;
}
}
int main() {
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
printf("%d\n", max(a, b, c));
return 0;
}