syhd142 |
|
|||
日歷
統計
導航常用鏈接留言簿(2)隨筆檔案(23)文章分類(270)
文章檔案(122)我的豆瓣搜索最新評論
閱讀排行榜
評論排行榜 |
#include <stdio.h>
#define N 1005 const double eps = 1e-6; double p[N], sum; int main() { int t, n, count; scanf("%d", &t); while(t--) { scanf("%d", &n); sum = count = 0; for(int i = 0; i < n; i++) { scanf("%lf", &p[i]); sum += p[i]; } sum /= n; for(int i = 0; i < n; i++) { if(p[i] - sum >= eps) count++; } printf("%.3lf%%\n", (double) count * 100 / n); } return 0; }
|
![]() |
|
Copyright © Fucker | Powered by: 博客園 模板提供:滬江博客 |