#include"stdio.h"
main()
{
int a,b,c,max,min;
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{
max=a;
min=b;
}
else
{
max=b;
min=a;
}
if(max>c)
printf("max=%d",max);
else
printf("max=%d",c);
if(min
else
printf("min=%d",c);
}
求最小值同理即可
#include
void main()
{
int a,b,c,max,min;
printf("Please input a b c\n");
scanf("%d,%d,%d",&a,&b,&c);
if(a>b) max=a,min=b;
else max=b,min=a;
if(c>max) max=c;
if(c
}
#include
{ int k;k=a>b?(a>c?a:c):(b>c?b:c);
return (k);
}
int min(int a,int b,int c)
{
int k;k=a return(k);
}
main()
{
int a,b,c,d,e;
printf("请输入三个数");
scanf("%d%d%d",&a,&b,&c);
d=min(a,b,c);
e=max(a,b,c);
printf("min=%d\tmax=%d\t",d,e);
}
#include
void main()
{
int a,b,c,max;
printf("a=");
scanf("%d",&a);
printf("b=");
scanf("%d",&b);
printf("c=");
scanf("%d",&c);
max=a>b?a:b;
max=max>c?max:c;
printf("max=%d\n",max);
}