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<bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[])
{
	int n;
	while(cin>>n,n)
	{
		int a[n],s=0;
		for (int i = 0; i < n; ++i) cin>>a[i],s+=a[i];
		double v=(double)s/n;
		int ans=0;
		for (int i = 0; i < n; ++i) if((double)a[i]<v+0.000001) ++ans;
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
    // Write Your Code Below
    while(1){
        int n; cin >> n;
        if(n==0) break;
        vector<int> v(n);
        ll sum=0;
        for(int i=0;i<n;i++){
            cin >> v[i];
            sum+=v[i];
        }
        double ave=(double)sum/n;
        int cnt=0;
        for(int i=0;i<n;i++){
            if(v[i]<=ave) cnt++;
        }
        cout << cnt << endl;
    }

}

C++: #include<bits/stdc++.h>
using namespace std;
#define BIG 1000000007
#define ll long long int

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

C++: //12/11アルゴリズム
#include<iostream>
using namespace std;

int main(){
  while(true){
    int n;
    cin>>n;

    if(n==0)break;

    int a[n];
    int sum=0;
    for(int i=0;i<n;i++){
      cin>>a[i];
      sum += a[i];
    }

    int avarage=sum/n;
    int poor=0;

    for(int i=0;i<n;i++){
      if(a[i]<=avarage){
        poor++;
      }
    }

    cout<<poor<<endl;
  }
  return 0;
}

C++: #include <algorithm>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define loop(i, x, n) for (int i = (x); i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define int long long
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e8;
template<typename T> void cmax(T &a, T b) { a = max(a, b); }
template<typename T> void cmin(T &a, T b) { a = min(a, b); }

signed main() {
  int n;
  while (cin >> n, n) {
    vector<int> a(n);
    int sum = 0;
    rep(i, n) {
      cin >> a[i];
      sum += a[i];
    }
    double avg = (double)sum / n;
    int ans = 0;
    rep(i, n) { ans += (a[i] <= avg); }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <deque>
#include <cctype>
#include <cstdio>
#include <math.h>
#include <set>
using namespace std;
int main(void){
    int x;
    cin >> x;
    while(x!=0){
        int total = 0;
    vector<int> a(x);
    int ans = 0; 
    for(int j=0;j<x;j++){
        cin >> a[j];
        total+=a[j];
    }
    total = total/x;
    for(int j=0;j<x;j++){
        if(total>=a[j]){
            ans++;
        }
    }
    cout << ans << endl;
    cin >> x;
    }
}

C++: #include <iostream>
#include <vector>

using namespace std;

int main() {
	int n; 
	while (cin >> n && n) {
		double ave = 0;
		vector<int> a(n);
		for (int i = 0; i < n; ++i) {
			cin >> a[i];
			ave += a[i];
		}
		ave /= ( double) n;
		int ans = 0;
		for (int i = 0; i < n; ++i)
			if (ave >= a[i]) ans++;
		cout << ans << endl;
	}
	return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    while(cin>>n, n){
        vector<ll> a(n);
        ll sum=0;
        for(int i=0;i<n;i++){
            cin>>a[i];
            sum += a[i];
        }
        int res=0;
        for(int i=0;i<n;i++){
            if(a[i]*n <= sum) res++;
        }
        cout<<res<<endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
    while(1){
	    int n; cin >> n;
        if(n==0) return 0;
        vector<int> a(n);
	    int sum=0;
        for(int i=0; i < n; i++){
            cin >> a[i];
            sum += a[i];
        }
        sum /= n;
        int cnt=0;
        for(int i=0; i < n; i++){
            if(a[i] <= sum) cnt++;
        }
        cout << cnt << endl;
    }
}
//./test < in > out

C++: #include <iostream>
using namespace std;

int main(void)
{
    int Members, Scores[10000], Total = 0, Poors = 0, i;

    while(true)
    {
        cin >> Members;
        if(!Members){ break; }
        for(i = 0; i < Members; i++)
        {
            Scores[i] = 0;
            cin >> Scores[i];
            Total = Total + Scores[i];
        }
        // Average = Total / Members;
        for(i = 0; i < Members; i++)
        {
            if(Scores[i] * Members <= Total){ Poors++; }
        }
        cout << Poors << "\n";
    }
}