663. 简单排序
作者:
erbaoerbao
,
2024-04-06 10:54:48
,
所有人可见
,
阅读 4
#include<iostream>
using namespace std;
const int N=3;
int a[N];
int main()
{
//freopen("xxx.in","r",stdin);
//freopen("yyy.out","w",stdout);
int sum=0;
for(int i=0;i<N;i++)
{
cin >> a[i];
sum+=a[i];
}
int max=a[0],min=a[0];
for(int i=0;i<N;i++)
{
if(a[i]>max)
max=a[i];
if(a[i]<min)
min=a[i];
}
cout << min << endl << sum-max-min << endl << max << endl;
cout << endl;
for(int i=0;i<N;i++)
{
cout << a[i] << endl;
}
//fclose(stdin);
//fclose(stdout);
return 0;
}