题解 | #记负均正#
记负均正
http://www.nowcoder.com/practice/6abde6ffcc354ea1a8333836bd6876b8
#include <stdio.h>
int main(){
int i,n,fu_n,zheng_n,m;
float out,top;
while(scanf("%d",&n)!=-1){
fu_n=0;
zheng_n=0;
top=0;
for(i=0;i<n;i++){
scanf("%d",&m);
if(m<0) fu_n++;
if(m>0) {
zheng_n++;
top+=m;
}
}
printf("%d %.1f\n",fu_n,top/zheng_n);
}
return 0;
}