1. 程式人生 > >將三個數從大到小列印

將三個數從大到小列印

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int a, b, c;
	printf("輸入3個數:\n");
		scanf("%d%d%d", &a,&b,&c);
		        if(a < b) {
			        a = a^b;
			        b = a^b;
			        a = a^b;
		}
			if(a < c) {
				a = a^c;
				c = a^c;
				a = a^c;
		}
			if(b < c) {
				b = b^c;
				c = b^c;
				b = b^c;
    	}
	printf("%d>%d>%d", a,b,c);
	system("pause");
}