编写函数int max(int a,int b,int c),求出a,b,c中的最大值,并返回

求详细过程,讲解一下 谢谢

第1个回答  2016-06-27
#include "stdio.h"int fun(int a, int b){ int c = b%10*1000+a/10*100+b/10*10+a%10; return c;}int main(void){ int m = 12, n = 54; printf("%d", fun(m,n)); return 0;}记得给我加分哦本回答被提问者采纳
第2个回答  2018-08-26
#include <stdio.h>
int main() {
// insert code here...
int a,b,c,imax;
printf("Please to input a,b,c:\n");
scanf("%d%d%d",&a,&b,&c);
imax=max(a,b,c);
printf("The maximum is %d.\n",imax);
}
int max(x,y,z)
int x,y,z;
{
int m;
if (x>y)
m=x;
else
m=y;
if (m<z)
m=z;
return (m);
}
第3个回答  2019-08-24
#include<stdio.h>
#include<stdlib.h>

int MAX(int a,int b,int c){
int M;
if((a>=b)&&(a>=c)){
M=a;
}
else if((b>=a)&&(b>=c)){
M=b;
}
else {
M=c;
}
return M;
}

int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d\n",MAX(a,b,c));
system("pause");
return 0;
}
相似回答