比较a,b,c的大小,用C语言编程,显示结果

来源:百度知道 编辑:UC知道 时间:2024/05/17 22:22:43
我 在 考试,快啊 谢谢啊
一定用C语言 啊 !!!!!!!!!!!!

main()
{

int a,b,c,t;
printf("input the numbers a b c:\n");
scanf("%d,%d,%d",&a,&b,&c);
if(a>b)
{t=a;
a=b;
b=t;}
if(a>c)
{t=a;
a=c;
c=t;}
if(b>c)
{t=b;
b=c;
c=t;}
printf("the sorted numbers is :%d ,%d,%d",a,b,c);
getch();
}

用strcmp比呗
但还用得着编程么
c〉b〉a
ascII码都是连续的.........