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++: #define D(x) cout << #x " = " << x << endl
#define DD(x, y) cout << "(" #x ", " #y ") = (" << x << ", " << y << ")" << endl
#define DDD(x, y, z) cout << "(" #x ", " #y ", " #z ") = (" << x << ", " << y << ", " << z << ")" << endl
#define DV(v) for (auto __macro_vi : v){ cout << __macro_vi << " ";} cout << endl;
#define DA(a, n) for (int __macro_i = 0; __macro_i < n; ++__macro_i) { cout << a[__macro_i] << " "; } cout << endl;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define ALL(v) (v).begin(), (v).end()
#include<iostream>
#include<vector>
#include<cassert>
#include<cmath>

using namespace std;

int main()
{
    while(1) {
        int n;
        cin >> n;
        if (n == 0) break;
        vector<int> a(n);
        int sm = 0;
        REP(i, n) {
            cin >> a[i];
            sm += a[i];
        }
        int ans = 0;
        REP(i, n) {
            if (a[i] * n <= sm) ans++;
        }
        cout << ans << endl;
    }
}

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

int main(){
  for(int i=0; ;i++){
      int n;
      cin >> n;
      if(n == 0){
          return 0;
      }
      vector<int>a(n);
      long long sum =0;
      for(int i=0;i<n;i++){
          cin >> a[i];
          sum += a[i];
      }
      int av = sum/n;
      int ans =0;
      for(int i=0;i<n;i++){
          if(a[i] <= av){
              ans++;
          }
      }
      cout << ans << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
long long aa;bool bb;char ch;
long long scan()
{
	while(ch=getchar(),(ch<'0'||ch>'9')&&ch!='-');
	ch=='-'?(bb=1,aa=0):(bb=0,aa=ch-48);
	while(ch=getchar(),(ch>='0'&&ch<='9'))
		aa=aa*10+ch-48;
	return (bb?(-aa):(aa));
}
int n,sum,cnt,a[10010];
int main()
{
	while(n=scan())
	{
		sum=0;
		cnt=0;
		for(int i=1;i<=n;++i)
		{
			a[i]=scan();
			sum+=a[i];
		}
		for(int i=1;i<=n;++i)
			if(a[i]*n<=sum)
				++cnt;
		printf("%d\n",cnt);
	}
	return 0;
}

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


int main(){
	while(1){
	int n;
	cin>>n;
	if(n==0)break;
	vector<double> a(n);
	double ave = 0.0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		ave+=a[i];
	}
	sort(a.begin(),a.end());
	ave++;
	ave/=n;
	auto it = lower_bound(a.begin(),a.end(),ave);
	cout<<(int)(it-a.begin())<<endl;

	}
	return 0;
}

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

int main(){
  int n=1;
  while(n!=0){
    cin >> n;
    if(n!=0){
    int a[n];
    int ave=0; //平均値
    int low=0; //平均以下
    for(int i=0;i<n;i++){
      cin >> a[i];
      ave += a[i];
    }
    ave = ave/n;
    for(int i=0;i<n;i++){
      if(a[i]<=ave){
        low++;
      }
    }
    cout << low << endl;
  }
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;

int main() {
    for (;;) {
        int n, a[100000];
        int ave = 0;
        cin >> n;
        if (0 == n) {
            break;
        }
        for (int i = 0; i < n; ++i) {
            cin >> a[i];
            ave += a[i];
        }
        ave /= n;
        int under = 0;
        for (int i = 0; i < n; ++i) {
            if (a[i] <= ave) {
                ++under;
            }
        }
        cout << under << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cmath>
#include <cstdlib>
#define LL long long

using namespace std;

const int maxn = 10000+7;
const double eps = 1e-6;

int n;
double sum,a[maxn];

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

        double ave=sum/n;
        int ans=0;
        for (int i=0;i<n;i++)
        {
            if (a[i]-ave<0 || abs(a[i]-ave)<eps) ans++;
        }

        printf("%d\n",ans);
    }
    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;
        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>
using namespace std;

int main(){
  while(true){
    int n;
    cin>>n;
    if(n==0){
      break;
    }
    int x=0;
    int tmp[n];
    for(int i=0;i<n;i++){
      cin>>tmp[i];
      x=x+tmp[i];
    }
    int f=x/n;
    int p=0;
    for(int i=0;i<n;i++){
      if(tmp[i]<=f){
        p++;
      }
    }
    cout<<p<<endl;
  }
}

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

int n, a[10005];

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

  }
  
  return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<sstream>
#include<random>
#include<cassert>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
const int inf = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};
#define ceil(a, b) a / b + !!(a % b)

void solve(int n) {
    int a[n];
    int sum = 0;
    rep(i, n) {
        cin >> a[i];
        sum += a[i];
    }
    double ave = (double)sum / n;
    sum = 0;
    rep(i, n) {
        if (a[i] <= ave) sum++;
    }
    cout << sum << endl;
}
int main() {
    int n;
    while (cin >> n && n) {
        solve(n);
    }
}

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

using namespace std;

int main(void) {
	vector<int> result(0);
	int n;
	cin >> n;
	while (n > 0) {
		vector<int> array(0);
		int sum = 0;
		for (int i = 0; i < n; i++) {
			int tmp;
			cin >> tmp;
			sum += tmp;
			array.push_back(tmp);
		}
		double avg = sum / n;
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (array[i] <= avg) {
				++count;
			}
		}
		result.push_back(count);
		cin >> n;
	}
	
	for (int &num:result) {
		cout << num << endl;
	}
	
	return 0;
}

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

int n,ans;
double ave;
vector<double> A;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> n,n){
        A.clear();
        ave=0;
        for (int i=0;i<n;++i){
            double a; cin >> a;
            ave+=a;
            A.emplace_back(a);
        }
        ave/=n; ans=0;
        for (int i=0;i<n;++i){
            if (A[i]<=ave) ++ans;
        }
        cout << ans << endl;
    }
}