#include  using namespace std;int n, i, temp, sum, a[100];int main(){\tcin>>n;\tfor (i = 1; i <= n; i  ) \t\tcin>>a[i];\tfor (i = 1; i <= n - 1; i  ) \t\tif (a[i] > a[i   1]) {\t\t\ttemp = a[i]; \t\t\ta[i] = a[i   1]; \t\t\ta[i   1] = temp;\t\t}\tfor (i = n; i >= 2; i--)\t\tif (a[i] < a[i - 1]) { \t\t\ttemp = a[i];\t\t\ta[i] = a[i - 1];\t\t\ta[i - 1] = temp;\t\t}\tsum = 0;\tfor (i = 2; i <= n - 1; i  ) \t\tsum  = a[i];\tcout<

输入:

8

40 70 50 70 20 40 10 30

输出:


点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部