#include <stdio.h>
int main() {
char name[1000];
double price=0.00,total=0.00,count = 0.00;
while(scanf("%s %lf %lf",name,&count,&price) !=EOF ){
total = total +(count*price);
}
printf("%0.1lf\n",total);
return 0;
}
这个题虽然是水题却wa好久,结果一看才发现是printf写在while里了,引以为戒。