//将三个数按从大到小输出//改变a,b,c的值输出#include<stdio.h>intmain(){int a =10;int b =55;int c =78;int temp =0;if(a<b)//如果a<b,交换a,b的值{
temp = a;
a = b;
b = temp;}if(a < c)//如果a<c,那么交换a,c的值{
temp = a;
a = c;
c = temp;}if(b<c)//如果b<c,那么交换b,c的值{
temp = b;
b = c;
c = temp;}printf("由大到小的顺序为:%d %d %d\n",a,b,c);return0;}
//将三个数按从大到小输出//不改变a,b,c的值,通过逻辑比较输出#include<stdio.h>int main(){ int a = 10; int b = 55; int c = 3; if(a > b) { if(b > c) //a>b>c printf("由大到小为:%d %d %d\n",a,b,c); else { if(a > c) //a>b b<c a>c