标签:
Time Limit: 1000MS | Memory Limit: 65536K | |
Total Submissions: 15028 | Accepted: 7875 |
5
5 50 50 70 80 100
7 100 95 90 80 70 60 50
3 70 90 80
3 70 90 81
9 100 99 98 97 96 95 94 93 91
40.000%
57.143%
33.333%
66.667%
55.556%
CODE:
#include <iostream> #include <cstdio> #include <cstring> #define REP(i, s, n) for(int i = s; i <= n; i ++) #define REP_(i, s, n) for(int i = n; i >= s; i --) #define MAX_N 1000 + 10 using namespace std; int main(){ int T, n, a[MAX_N]; scanf("%d", &T); while(T --){ double sum = 0; scanf("%d", &n); REP(i, 1, n) scanf("%d", &a[i]), sum += (double)a[i]; sum /= n; int ans = 0; REP(i, 1, n) if((double)a[i] > sum) ans ++; printf("%.3f%c\n", (double)ans / n * 100, ‘%‘); } //system("pause"); return 0; }
标签:
原文地址:http://www.cnblogs.com/ALXPCUN/p/4521364.html