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 |
怎么会runtime error??????????#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator