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 |
天啊,这错在哪啊#include <stdio.h> void main() { int n , i , j , m , sum , temp , count , a[1000] ; double b[15] ; scanf( "%d" , &n ) ; for( i = 0 ; i < n ; ++ i ) { scanf( "%d" , &m ) ; sum = 0 ; for( j = 0 ; j < m ; ++ j ) scanf( "%d" , &a[j] ) ; for( j = 0 ; j < m ; ++ j ) sum += a[j] ; temp = sum / m ; count = 0 ; for( j = 0 ; j < m ; ++ j ) if( a[j] > temp ) count ++ ; b[i] = (double)count / m * 100 ; } for( i = 0 ; i < n ; ++ i ) printf( "%.3lf%%\n" , b[i] ) ; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator