#include<stdio.h>
int main()
{double a,b,sum=0;char str[20];while(scanf("%s%lf%lf",str,&a,&b)!=EOF){sum+=a*b;}printf("%0.1lf\n",sum);return 0;
}
详细解决方案
hdu 2090 算菜价
热度:51 发布时间:2023-12-04 20:16:59.0
#include<stdio.h>
int main()
{double a,b,sum=0;char str[20];while(scanf("%s%lf%lf",str,&a,&b)!=EOF){sum+=a*b;}printf("%0.1lf\n",sum);return 0;
}