| ||||||||||
| 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 | |||||||||
多简洁的代码- -!想到数据都过了,可是为嘛还wa#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int a,b,c;
int arr[10005],sum=0;
float f;
cin>>a>>b;
for(int i=0;i<a;i++)
{cin>>f;
arr[i]=(f+0.005)*100;
}
while(++sum){
c=0;
for(int i=0;i<a;i++)
c+=arr[i]/sum;
if(c<b) break;
}
f=(sum-1)/100.0;
printf("%.2lf",f);
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator