Sunday, August 28, 2016

uri- 1216 - Getline One

#include <stdio.h>

int main(){
    char s[101];
    double d, t, n = 0.0;
    while(gets(s)){
        scanf("%lf", &d);
        t += d;
        n += 1.0;
    }
    printf("%.1lf\n", t / n);
    return 0;
}

No comments: