三个数排序问题
#include<iostream>
#include<stdio.h>
#include<string>using namespace std;
int main()
{int a, b, c, t;cout << "輸入三個數" << endl;cin >> a>>b>> c;if (a < b){t = a;a = b;b = t;}if (a < c){t = a;a = c;c = a;}if (b < c){t = b;b = c;c = b;}cout << "輸出三個大小排序的數" << a<< b<< c << endl;system("pause");return 0;
}
總結