加入收藏 | 设为首页 | 会员中心 | 我要投稿 北几岛 (https://www.beijidao.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

输入4个整数,找出其中最大的数。未用函数的嵌套调用来处理

发布时间:2021-05-20 09:47:02 所属栏目:大数据 来源: https://blog.csdn.net/summoxj
导读:#include stdio.h #include conio.h int main(){ ? int max(int,int); ? printf("请输入四个数:n"); ? int a,b,c,d,max1,max2,max3; ? scanf("%d,%d,%d",a,b,c,d); ? max1=max(a,b); ? max2=max(max1,c); ? max3=max(max2,d); ? printf("最大数为:%d",max3

#include <stdio.h>

#include <conio.h>
int main(){
? int max(int,int);
? printf("请输入四个数:n");
? int a,b,c,d,max1,max2,max3;
? scanf("%d,%d,%d",&a,&b,&c,&d);
? max1=max(a,b);
? max2=max(max1,c);
? max3=max(max2,d);
? printf("最大数为:%d",max3);
? getch();
? return 0;
}?
int max(int x,int y){
? int z;
? z=x>y?x:y;
? return z; ? ?
}


(编辑:北几岛)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读