c语言的题

小太子他爸 |浏览287次
收藏|2022/11/29 07:06

满意回答

2022/11/29 07:19

已完成max()函数,包括主函数的整个程序如下:#include<stdio.h>void max(int a,int b,int c);void main(){int a1,b1,c1;voi不宜没d main(){int 360问答a1,b1,c1;prin判只否础元满曲境曲tf("请输入三个整数:");scanf("%d%d%d",&a1,&b1,&c1);printf("上述三个整数的最大值为:");max(a1,b1,c1);printf("\n");}/*函数功能:计算三个整蛋病田千数中的最大值*/void max(int a,int b,int c){ int temp; if(a<b) { t经并坏菜理信体emp=b; b=a; a=temp; } if(a<c) { temp=c; c=a; a=temp; } if(b<c) { temp=c; c=说风占老b; b=temp; } printf("%d\n",a);}由于程序的运行结旧短负袁果图片问答系统无法上传站著导内斗型免达沿,你可自行运行验证一下。

ygl990951

其他回答(1)
  • 这个是入门级的:参考(方法有多种)全验void max(int a, int b, int c){int m=a;if (m<b)m=b;if (m<c)m=c;printf("%d",准数确顶医大m);}
    回答于 2022/11/29 07:30
0人关注该问题
+1

 加载中...