mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-11-27 14:36:19 +00:00
22 lines
321 B
C
22 lines
321 B
C
#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;
|
|
}
|