第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;
}