题解 | 最大最小值

最大最小值

https://www.nowcoder.com/practice/051cbca4504d40f5b20bb891d83ec408

#include <stdio.h>

int main() {
    int a, b, c;
    
    scanf("%d %d %d", &a, &b, &c);
    
    int max_num = a;
    if (b > max_num) {
        max_num = b;
    }
    if (c > max_num) {
        max_num = c;
    }
    
    int min_num = a;
    if (b < min_num) {
        min_num = b;
    }
    if (c < min_num) {
        min_num = c;
    }
    
    printf("The maximum number is : %d\n", max_num);
    printf("The minimum number is : %d\n", min_num);
    
    return 0;
}

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-25 17:55
点赞 评论 收藏
分享
06-13 10:15
门头沟学院 Java
想去夏威夷的大西瓜在...:我也是27届,但是我现在研一下了啥项目都没有呀咋办,哎,简历不知道咋写
点赞 评论 收藏
分享
07-21 12:41
已编辑
门头沟学院 Java
steelhead:不是你的问题,这是社会的问题。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务