题目描述
从键盘输入三个整数 x,y 和 z, 求出其中最大的数.
输入
输入三个整数, 用空格隔开.
输出
输出最大整数.
样例输入 Copy
20 16 18
样例输出 Copy
20
编译环境:
VS
代码:
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main()
- {
- int x, y, z,max;
- scanf("%d %d %d",&x,&y,&z);
- if (x> y) {
- max = x;
- }
- else {
- max = y;
- }
- if (z> max) {
- max = z;
- }
- printf("%d",max);
- return 0;
- }
posted on 2019-08-21 19:59 涟涟 阅读 (...) 评论 (...) 编辑 收藏
来源: https://www.cnblogs.com/wangmengru/p/11390396.html