#includevoid main(){int a,b,c,max,min;for(a=0;ac>b){max=a;min=b;}if(b>a>c){max=b;min=c;}if(b>c>a){max=b;min=a;}if(c>a>b){max=c;min=b;}if(c>b>a){max=c;min=a;}if(max-min==9)continue;printf("%d%d%d",a,b,c);printf(" ");}}}}我做的是这样的,怎么才
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 15:08:32
#includevoid main(){int a,b,c,max,min;for(a=0;ac>b){max=a;min=b;}if(b>a>c){max=b;min=c;}if(b>c>a){max=b;min=a;}if(c>a>b){max=c;min=b;}if(c>b>a){max=c;min=a;}if(max-min==9)continue;printf("%d%d%d",a,b,c);printf(" ");}}}}我做的是这样的,怎么才
#include
void main()
{
int a,b,c,max,min;
for(a=0;ac>b){max=a;min=b;}
if(b>a>c){max=b;min=c;}
if(b>c>a){max=b;min=a;}
if(c>a>b){max=c;min=b;}
if(c>b>a){max=c;min=a;}
if(max-min==9)continue;
printf("%d%d%d",a,b,c);
printf(" ");
}
}
}
}
我做的是这样的,怎么才能求a,b,c,中的最大/小值,并将值分别赋予max和min
#includevoid main(){int a,b,c,max,min;for(a=0;ac>b){max=a;min=b;}if(b>a>c){max=b;min=c;}if(b>c>a){max=b;min=a;}if(c>a>b){max=c;min=b;}if(c>b>a){max=c;min=a;}if(max-min==9)continue;printf("%d%d%d",a,b,c);printf(" ");}}}}我做的是这样的,怎么才
#include
void main()
{
int a,b,c,max,min;
scanf("%d%d%d",&a,&b,&c);//首先应该让用户输入三个数a b c
if(a>b)
{
if(b>c)
{max=a;min=c;}
else
if(a>c)
{max=a;min=b;}
else
{max=c;min=b;}
}
else
{
if(a>c)
{max=b;min=c;}
else
if(b>c)
{max=b;min=a;}
else
{max=c;min=a;}
}
printf("max=%d min=%d",max,min);
}