mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1751.c
This commit is contained in:
parent
2b488b0f72
commit
f4193b2898
28
QUSTOJ/1751.c
Normal file
28
QUSTOJ/1751.c
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user