From f4193b2898350d74b29c934734404080b5df6fb0 Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Thu, 26 May 2016 07:39:02 +0800 Subject: [PATCH] Create 1751.c --- QUSTOJ/1751.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 QUSTOJ/1751.c diff --git a/QUSTOJ/1751.c b/QUSTOJ/1751.c new file mode 100644 index 0000000..1d4100d --- /dev/null +++ b/QUSTOJ/1751.c @@ -0,0 +1,28 @@ +#include +#include +#include + +int a[16]; + +int cmp(const void* a,const void* b) +{ + return *(int*)a-*(int*)b; +} + +int main() +{ + for(int i=0;i<10;i++) + { + scanf("%d",&a[i]); + } + qsort(a,10,sizeof(int),cmp); + for(int i=9;i>=0;--i) + { + printf("%d ",a[i]); + } + printf("\n"); + int sum=0; + for(int i=1;i<9;i++) + sum+=a[i]; + return printf("%.2f\n",(double)sum/8),0; +}