OJ-Problems-Source/CodeVS/1023_冰封.c
2016-07-06 14:28:18 +08:00

20 lines
330 B
C

/*
作者:千里冰封
题目:p1023 GPA计算
*/
#include <stdio.h>
int main(int argc, char* argv[]){
int a, i,c = 0, m = 0;
float n = 0.0, tol = 0.0;
scanf("%i", &a);
for(i = 0; i < a; i++){
scanf("%i%f", &m, &n);
tol += m * n;
c += m;
}
printf("%.2f", tol / c);
return 0;
}