Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 years ago
516 B
2
Indexable
Never
#include <bits/stdc++.h>

using namespace std;

int main() {
    
    int len;
    cin>>len;
    int a[len];
    
    for(int i=0;i<len;i++) cin>>a[i];
    
    float avg = 0;
    
    for(int i=0;i<len;i++) {
        
        avg+=a[i];
    }
    
    avg/=len;
    
    float check = floor(avg);
    
    if(check != avg) cout<<0;
    else {
        
        int count=0;
        for(int i=0;i<len; i++) {
            if(avg==(float)a[i]) count++;
        }
        
        cout<<count;
    }
    
    return 0;
}