int main(){ int nNum1 = 0, nNum2 = 0, nNum3 = 0 ; int *pNum1 = &nNum1,*pNum2 = &nNum2 , *pNum3 = &nNum3; printf( " 输入第一个数: "); scanf_s(" %d ",pNum1); printf( " 输入第二个数: "); scanf_s(" %d ",pNum2); printf( " 输入第三个数: "); scanf_s(" %d ",pNum3) ; printf( "从小到大排序后: "); if( *pNum1 > *pNum2){ int *pTemp = pNum1; pNum1 = pNum2; pNum2 = pTemp; } if( *pNum1 > *pNum3 ){ int *pTemp = pNum1; pNum1 = pNum3; pNum3 = pTemp; } if( *pNum2 > *pNum3){ int *pTemp = pNum2 pNum2 = pNum3; pNum3 = pTemp; } }