是根据商品的原价和折扣率计算商品实际售价,尽量不要增行和删行
#include <stdio.h>
void main() {
double cost, percent, c;
printf("PleaseEntertheFirstPrice: ");
scanf("%lf", &cost);
printf("请输入折扣率:");
scanf("%lf", &percent);
c = cost * percent;
printf("商品实际售价为: %.2lf\n",c);
}
效果:
兄弟,练一下编程格式吧,看着好乱int值都没定义