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

怎么会runtime error??????????

Posted by ss145236 at 2010-04-06 02:52:00 on Problem 2350
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
    
    int n,i,l[100];
    int	t=1,s=0,c=0,f;
    double a;
    cin>>n;
    while(n--)
    {
	int m;
	cin>>m;
	f=m;
	while(m--)
	{
	    cin>>l[t++];
	    s+=l[t-1];
	}
	a=(double)s/f;

	for(i=1;i<=f;i++)
	{
	    if (l[i]>a) c++;
	}
	a=(double)c*100/f;
	cout<<fixed<<setprecision(3)<<a<<"%"<<endl;
    }
    return 0;
}


到底哪个语句耗时间啊???

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