vc++比较三个数的大小

#include "stdio.h"
main()
{
int a,b,c,temp;
printf("输入三个整数:\n");
scanf("%d%d%d",&a,&b,&c);
if (a>=b) {temp=a;a=b;b=temp;}
if (a>=c) {temp=a;a=c;c=temp;}
if (b>=c) {temp=b;b=c;c=temp;}
printf("Min=%d Mid=%d Max=%d\n",a,b,c);
}

 

posted @ 2015-12-24 09:36  星雷热忱  阅读(1015)  评论(0编辑  收藏  举报