#include<stdio.h>
(30951)#include<math.h>
int main()
{
    int num;
    int a[1000];
    while(scanf("%d",&num)!=EOF)
    {
        int count = 0;
        int countint =0;
        float sum = 0;
        for(int i =0;i<num;i++)
        {
            scanf("%d",&a[i]);
            if(a[i]<0)
            {
                count++;
            }
            if(a[i]>0)
            {
                countint++;
                sum+=a[i];
            }
        }
        printf("%d %0.1f\n",count,countint>0?sum/countint:0);
    }
}
全部评论

相关推荐

一表renzha:手写数字识别就是一个作业而已
点赞 评论 收藏
分享
评论
点赞
7
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务