dsaljkfgklj;asdfkjlsa

#include<stdio.h>
int main()
{
    int count,i,num;
    double grade,total,average;
    
    total=0;
    num=0;
    count=0;
    scanf("%lf",&grade);

    for(i=0;i<=19;i++){
        if(grade>=0){
        total=total+grade;
        num++;
        }
        else if(grade<0){
        count++;
        }
        scanf("%lf",&grade);
    average=total/num;
    printf("%.0d\n",count);
    printf("%.2lf\n",average);
    return 0;
}

 

posted @ 2013-12-12 09:55  傻子疯子捏子  阅读(282)  评论(0编辑  收藏  举报