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

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

发布时间:2021-07-06 05:40:01 所属栏目:大数据 来源: https://blog.csdn.net/summoxj
导读:#include stdio.h #include conio.h int main(){ ? int max4(int,int,int); ? printf("请输入四个数:n"); ? int a,b,c,d,max; ? scanf("%d,%d,%d",a,b,c,d); ? max=max4(a,d); ? printf("最大数为:%d",max); ? getch(); ? return 0; }? int max4(int a,int
#include <stdio.h>
#include <conio.h>
int main(){
? int max4(int,int,int);
? printf("请输入四个数:n");
? int a,b,c,d,max;
? scanf("%d,%d,%d",&a,&b,&c,&d);
? max=max4(a,d);
? printf("最大数为:%d",max);
? getch();
? return 0;
}?
int max4(int a,int b,int c,int d){
? int max2(int,int);
? int m;
? m=max2(a,b);
? m=max2(m,c);
? m=max2(m,d);
? return m;

}

/*int max4(int a,int d){

int m;

m=max2(max2(max2(a,b),c),d);

}*/

int max2(int a,int b){
? if(a>=b)
? ? return a;
? else
? ? return b;

}


(编辑:北几岛)

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

    推荐文章
      热点阅读