很简单。最大的差值肯定是最大的数和最小的数的差。程序如下:
#include<bits/stdc++.h> using namespace std; int a,b,c; int main(){ cin>>a>>b>>c; cout<<max(max(a,b),c)<<' '<<min(min(a,b),c); /* max函数:求最大值 min函数:求最小值 */ return 0; }