| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:你的while条件错了In Reply To:有人帮忙看下吗? 不知道那里没有注意了? Posted by:zhouhai2118 at 2008-08-17 11:54:25 > #include <stdio.h>
> #include <stdlib.h>
>
> int cmp(const void *p1, const void *p2)
> {
> return *(long *)p1 - *(long *)p2;
> }
>
> int main()
> {
> long s[6];
> int i;
>
> while(1)
> {
> for( i=0;i<6;i++)
> scanf("%d",&s[i]);
> if((s[0]+s[1]+s[2]+s[3]+s[4]+s[5]) == 0) break;
> qsort(s,6,sizeof(s[0]),cmp);
> printf("%g\n",(s[1]+s[2]+s[3]+s[4])/4.0);
> }
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator