Go: package main

import "fmt"

func main() {

     for ; true ; {
     var n int
     fmt.Scan(&n)
     if n == 0 { break }
     a := make([]float64, n)
     var sum float64 = 0
     for i := 0; i < n; i++ {
     	 fmt.Scan(&a[i])
	 sum += float64(a[i])
     }
     sum /= float64(n)
     ans := 0
     for i := 0; i < n; i++ {
     	 if a[i] <= sum {
	    ans += 1
	 }
     }
     fmt.Println(ans)
     }
}

C++: #include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<functional>
#include<utility>
#include<algorithm>
using namespace std;

typedef long long ll;
const int maxn = 1e4 + 10;
int a[maxn];

int main()
{
	ios::sync_with_stdio(false);
	int n;
	while (scanf("%d", &n) == 1 && n)
	{
		int sum = 0;
		for (int i = 1; i <= n; i++)
		{
			scanf("%d", &a[i]);
			sum += a[i];
		}
		int cnt = 0;
		for (int i = 1; i <= n; i++)
			if (n*a[i] <= sum) cnt++;
		printf("%d\n", cnt);
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main() {
	int n;
	while (cin >> n, n) {
		double avr = 0; int p[11000];
		for (int i = 0; i < n; i++) {
			cin >> p[i];
			avr += p[i];
		}
		avr /= n;
		int ans = 0;
		for (int i = 0; i < n; i++)ans += (p[i] <= avr);
		cout << ans << endl;
	}
}

C++: #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/




int N, A[10101];
//---------------------------------------------------------------------------------------------------
void _main() {
    while (cin >> N) {
        if (N == 0) return;
        rep(i, 0, N) cin >> A[i];

        int sm = 0;
        rep(i, 0, N) sm += A[i];

        int ans = 0;
        rep(i, 0, N) if (A[i] * N <= sm) ans++;
        printf("%d\n", ans);
    }
}

C++: #include<bits/stdc++.h>

#define fi first
#define se second
#define show(x) cerr << #x << "=" << "\n"
typedef long long ll;
typedef unsigned long long ull;

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
#ifdef LOCAL_DEFINE
  FILE *stream1;
  FILE *stream2;
  stream1 = freopen("in.txt", "r", stdin);
  stream2 = freopen("out.txt", "w", stdout);
  if (stream1 == NULL) return 0;
  if (stream2 == NULL) return 0;
#endif
  int n;
  while (cin >> n, n) {
    int sum = 0;
    int a[10001];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      sum += a[i];
    }
    int ans = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] * n <= sum) ans++;
    }
    cout << ans << endl;
  }
#ifdef LOCAL_DEFINE
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s.\n";
  fclose(stream1);
  fclose(stream2);
#endif
  return 0;
}

C++: #include <cstdio>
int main() {
    int N;

    while(scanf("%d", &N), N) {
        int sum = 0, A[10010];
        for(int i=0; i<N; i++) {
            scanf("%d", &A[i]);
            sum += A[i];
        }

        int ans = 0;
        for(int i=0; i<N; i++) {
            ans += (N * A[i] <= sum);
        }
        printf("%d\n", ans);
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
  long long n;
  while (cin >> n && n) {
    long long i,ret=0;
    double sum = 0,a[n];
    for(i=0;i<n;i++){
      cin >> a[i];
      sum+=a[i];
    }
    sum/=(double)n;
    for(i=0;i<n;i++){
      if(sum>=a[i])ret++;
    }
    cout << ret << endl;
  }
  return 0;
}