| ||||||||||
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 |
咋是wronganswer呀!帮忙看看吧!谢谢!#include "stdio.h" #include "string.h" int main() { long c[10001]={'\0'}; char s[10]={'\0'}; int m; long a, average, b, i, k, j; long long sum=0, x[9]={1,10,100,1000,10000,100000,1000000,10000000,100000000}; scanf("%ld %ld",&a,&b); for ( i=0; i<a; i++) { scanf("%s",s); m=strlen(s); for( j=0,k=m-2; j<m; j++) if(s[j]!='.') c[i] += (s[j]-'0')*x[k--]; sum += c[i]; } average = sum/b; for ( i=average; i>0; i--) { k=0; for ( j=0; j<a; j++) { k += c[j]/i; } if( k>=b ) break; } printf("%.2f\n",i/100.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