Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
2510 | 王兮 | 找找谁的身高超过全班的平均身高 | C++ | Runtime Error | 0 | 0 MS | 260 KB | 294 | 2019-11-28 21:01:18 |
#include<iostream> int main() { int n,a[100],i,sum=0; scanf("%d",&n); for(i=0;i<=n-1;i++) { scanf("%d",a[i]); } for(i=0;i<=n-1;i++) { sum=sum+a[i]; } sum=sum/n; printf("%d",sum); for(i=0;i<=n-1;i++) { if(a[i]>=sum) { printf("%d:%d",i,sum); } } }