C语言求按大小顺序打印三个整数程序
C语言求按大小顺序打印三个整数程序
程序代码:#include <stdio.h>
#include <string.h>
int main()
{
int a,b,c;
int temp;
scanf("%d %d %d",&a,&b,&c);
if(a>b)
{
temp = a;
a = b;
b = temp;
}
if(b>c)
{
temp = c;
c = b;
b = temp;
}
if(a>b)
{
temp = a;
a = b;
b = temp;
}
printf("%d %d %d",a,b,c);
return 0;
}









