Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
100372 罗迎甲 18高于平均分的学生数量 C++ Accepted 1 MS 268 KB 608 2024-12-07 16:39:00

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n; cin>>n; int a[n]; double man1; int man2=0,man3=0; for(int z=0;z<n;z++){ cin>>a[z]; } for(int z=0;z<n;z++){ man3+=a[z]; } man1=man3/n; for(int z=0;z<n;z++){ if(man1<a[z]) man2=man2+1; } cout<<man2<<" "; return 0; }