#include <stdio.h> void main() { double weight; double price; double single_price; printf("请输入单个商品重量(g):"); scanf("%lf", &weight); printf("请输入商品一斤的价格(元):"); scanf("%lf", &price); single_price=price/(500.0 / weight); printf("该商品一个为:%0.2lf元", single_price); }
07-30
396
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)