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 |
这个是对比程序。难道是输入输出流的问题?In Reply To:这几个simple太阴险了 Posted by:baicaited at 2009-04-30 23:29:25 #include"iostream" using namespace std; int main() { int i=0,n,count=0,m,j; float sum,ave,a[1009]; scanf("%d",&n); while(i<n) { count=0;sum=0; i++; scanf("%d",&m); for( j=0;j<m;j++) { scanf("%f",&a[j]); sum+=a[j]; } ave=sum/m; for(j=0;j<m;j++) if(a[j]>ave) count++; printf("%.3f%%\n",(float) count/m*100); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator