OJ-Problems-Source/CodeVS/1023_冰封.c

20 lines
330 B
C
Raw Permalink Normal View History

2016-07-06 14:28:18 +08:00
/*
:
: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;
}