Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

天啊,这错在哪啊

Posted by maijunsheng at 2006-09-28 23:42:25 on Problem 2350
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator