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 <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18) + 1;
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
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;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int n, m;
vector<int> a;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<ll>ans; 
    while(true){
        cin>>n;
        if(n==0)break;
        vector<ll> a(n);
        double sum=0;
        rep(i,n){
            cin>>a[i];
            sum+=a[i];
        }
        sum=sum/n;
        ll count=0;
        rep(i,n){
            if(a[i]<=sum){
                count++;
            }
        }
        ans.push_back(count);
    }
    rep(i,ans.size()){
        cout<<ans[i]<<"\n";
    }
}

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

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

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

int main() {
  std::ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  while (true) {
    int n;
    cin>>n;
    if (!n) {
      break;
    }
    int a[n];
    double average=0;
    for (int i=0; i<n; i++) {
      cin>>a[i];
      average+=a[i];
    }
    average/=n;
    int ans=0;
    for (int i=0; i<n; i++) {
      if (a[i]<=average) {
	ans++;
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<vector>
#include<numeric>
using namespace std;
int main(){
    while(true){
        int N;
        cin>>N;
        if(N==0)break;
        vector<int> a(N);
        for(int i =0;i<N;i++){
            cin>>a[i];
        }
        int ave = accumulate(a.begin(),a.end(),0)/a.size();
        int ans=0;
        for(int i=0;i<N;i++){
            if(a[i]<=ave)ans++;
        }
        cout<<ans<<endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define be(x) x.begin(),x.end()
using namespace std;
typedef long long ll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};

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

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int n,a[10005],sum;
#define rep(i,n) for(int i=0;i<n;i++)

int main()
{
	while(1){
		cin>>n;if(n==0) return 0;
		sum = 0;
		rep(i,n) {cin>>a[i];sum+=a[i];}
		int cnt = 0;
		rep(i,n) if(a[i] <= sum/n) cnt++;
		cout << cnt << endl;
	}
}

C++: #include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <ctime>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 510000;
ll dy[8] = {0,1,0,-1,1,-1,1,-1};
ll dx[8] = {1,0,-1,0,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T> inline void print(T &a){
    rep(i,a.size()) cout << a[i] << " ";
    cout << "\n";
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << "\n";}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << "\n";
}
//const int mod = 1e9 + 7;
const int mod = 998244353;

int main(){
	while(1){
		int n; cin >> n;
		if(!n) break;
		vector<int> a(n);
		int sum = 0;
		rep(i,n) cin >> a[i], sum += a[i];
		int ans = 0;
		rep(i,n){
			if(a[i] * n <= sum) ans++;
		}
		cout << ans << "\n";
	}
}

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

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

        if(n==0){
            break;
        }
        int a[n];
        int max=0;
        double ave=0;
        for(int i=0; i<n; i++){
            cin>>a[i];
            max += a[i];
        }
        ave = max/n;

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

        cout << cnt << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
using namespace std;

signed main(){
    while(1){
        int n;
        cin>>n;
        if(!n)break;
        int a[n];
        rep(i,n)cin>>a[i];
        int s=0;
        rep(i,n)s+=a[i];
        s/=n;
        int ans=0;
        rep(i,n)ans+=(a[i]<=s);
        cout<<ans<<endl;
    }
    return 0;
}