mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-12-16 15:44:39 +00:00
42 lines
547 B
Markdown
42 lines
547 B
Markdown
|
# 6-2 三整数最大值
|
||
|
|
||
|
请编写函数,求三个整数的最大值。
|
||
|
|
||
|
#### 函数原型
|
||
|
|
||
|
```c
|
||
|
int IntMax3(int x, int y, int z);
|
||
|
```
|
||
|
|
||
|
说明:参数 x、y 和 z 为三个整数,函数值为三个整数中的最大值。
|
||
|
|
||
|
#### 裁判程序
|
||
|
|
||
|
```c++
|
||
|
#include <stdio.h>
|
||
|
|
||
|
int IntMax3(int x, int y, int z);
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
int a, b, c, d;
|
||
|
scanf("%d%d%d", &a, &b, &c);
|
||
|
d = IntMax3(a, b, c);
|
||
|
printf("%d\n", d);
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
/* 你提交的代码将被嵌在这里 */
|
||
|
```
|
||
|
|
||
|
#### 输入样例
|
||
|
```in
|
||
|
15 36 -27
|
||
|
|
||
|
```
|
||
|
#### 输出样例
|
||
|
```out
|
||
|
36
|
||
|
|
||
|
```
|