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 <iostream>
#include <cstring>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <queue>
#include <functional>
#include <stack>
#include <map>
#include <vector>
#include <cmath>
#define ll long long
#define REP(i,n) for(int i=0;i<(n);i++)
#define PB push_back
#define MP make_pair
using namespace std;
int main(){
    for(;;){
        int n;
        cin>>n;
        if(n==0)
            break;
        int a[n];
        int tot=0;
        for(int i=0;i<n;i++){
            cin>>a[i];
            tot+=a[i];
        }
        tot/=n;
        int res=0;
        for(int i=0;i<n;i++){
            if(a[i]<=tot)
                res++;
        }
        cout<<res<<endl;
    }
}

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

int n,a[10005];

int main()
{
    while (scanf("%d",&n)==1)
    {
        if (n==0) break;
        int sum=0;
        for (int i=1;i<=n;i++)
        {
            scanf("%d",&a[i]);
            sum+=a[i];
        }
        int ans=0;
        for (int i=1;i<=n;i++)
        {
            if (a[i]*n<=sum) ans++;
        }
        printf("%d\n",ans);
    }
}

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

#define MAX 10000
int main(){
	int a[MAX];
	int n;
	while(1){
		cin>>n;
		if(n==0)break;
		int sum=0, ans=0;

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

		cout<<ans<<endl;
	}

	return 0;
}

C++: #include<bits/stdc++.h>
#define LL long long
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define PII pair<int,int>
#define PLI pair<long long, int>
#define PLL pair<long long, long long>
#define PDD pair<double, double>
#define MOD ((int)1e9 + 7)
#define INF ((int)2e9)
#define INFLL ((LL)2e18)
#define ALL(x) (x).begin(),(x).end()
#define ctoi(x) (x - 'a') 
#define CTOI(x) (x - 'A')
#define BIT(x) (2 << (x))
using namespace std;

LL modinv(LL a){
    LL b = MOD, u = 1, v = 0;
    while(b){
        LL t = a / b;
        a -= t * b;swap(a, b);
        u -= t * v;swap(u, v);
    }
    u%=MOD;
    if(u < 1) u += MOD;
    return u;

}

LL exp(LL a, LL b){
    LL res = 1;
    LL sum = a;
    while(b){
        if(b&1)res = (res * sum);
        sum = (sum * sum);
        b>>=1;
    }
    return res;
}

double exp(double a, LL b){
    double res = 1;
    double sum = a;
    while(b){
        if(b&1)res = (res * sum);
        sum = (sum * sum);
        b>>=1;
    }
    return res;
}

signed  main(){
    int N;
    while(cin>>N&&N){
        LL sum = 0;
        vector<LL> line(N);
        for(auto &i:line){
            cin >> i;
            sum += i;
        }
        LL avg=sum/N;
        int ans = 0;
        for(auto i:line){
            ans += i <= avg;
        }
        cout << ans << endl;
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
 
int main(){
  int n,ans;
  double ave,sum;
 
  while(1){
    cin >> n;
    if(n==0){
      break;
    }
 
    int a[n];
 
    for(int i=0;i<n;i++){
      cin >> a[i];
      sum += a[i];
    }
    ave = sum / n;
 
    for(int i=0;i<n;i++){
      if(ave >= a[i]){
        ans++;
      }
    }
 
    cout << ans << endl;
    sum = 0;
    ans = 0;
  }
 
  return 0;
}

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

int main(void)
{
    int Members, Scores[10000], Total = 0, Average, 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] <= Average)
            {
                Poors++;
            }
        }
        cout << Poors << "\n";
    }
}

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

#define LL long long

using namespace std;

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

C++: #include<iostream>
using namespace std;
int main(void){
    for(;;){
        int n;
        cin >> n;
        if(n==0){return 0;}
        int a[n];
        for(int i=0;i<n;i++){
            cin >> a[i];
        }
        long long int sum=0;
        for(int i=0;i<n;i++){
            sum += a[i];
        }
        int ave = sum/n;
        int cnt = 0;
        for(int i=0;i<n;i++){
            if(a[i]<=ave){cnt++;}
        }
        cout << cnt << endl;
    }
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<bitset>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define rep(i,n) for(i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define INF INT_MAX
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define vvc vector<vector<char> >
#define vvs vector<vector<string> >
#define P 1000000007
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const long long LLINF=1LL<<60;
//set<int>::iterator it;
//|\_
//g++ -std=c++1z temp.cpp
//./a.out





int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
    int n;
    while(1){
        cin>>n;
        if(n==0)break;
        int i,ans=0;
        vector<int> v(n,0);
        double sum=0;
        rep(i,n){
            cin>>v[i];
            sum+=v[i];
        }
        sum/=n;
        rep(i,n)if(v[i]<=sum)ans++;
        
        cout<<ans<<endl;
    }
//////////////////////////////////////////////////////
return 0;}

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

int main(){
  int income[10000];
  int n;
  while(1){
    cin >> n;
    if(n==0){
      break;
    }
    int total=0;
    for(int i=0;i<n;i++){
      cin >> income[i];
      total += income[i];
    }
    int ave = total/n;
    int cnt=0;
    for(int i=0;i<n;i++){
      if(ave>=income[i])
        cnt++;
      }
      cout << cnt << endl;
    }
}

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;

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

C++: #include<iostream>
using namespace std;
int t[10005];
int main(){
	int n;
	int a,b,c;
	int i,j,k;
	while(cin>>n){
		if(!n)break;
		a=0;
		for(i=0;i<n;i++){
			cin>>t[i];
			a+=t[i];
		}
		a/=n,b=0;
		for(i=0;i<n;i++){
			if(t[i]<=a)b++;
		}
		cout<<b<<endl;
	}
}