河池化工东方:C语言基础题目,求助!

来源:百度文库 编辑:高考问答 时间:2024/04/27 01:47:20
程序功能:根据商品的原加和折扣率,计算商品的实际售价。请在程序中的横线处填写正确的语句,使程序完整。

#include "stdio.h"
void main()
{ float cost,percent;
printf("Please input the price before :");
scanf( " ",&cost);
printf("\n Please input percent:");
scanf( );
printf("The price now is %6.2f", );
}
就是这三处

你的横线在哪里??
scanf( " ",&cost); ???
scanf( ); ???
printf("The price now is %6.2f", ); ???
是不是这三处??
scanf( "%f",&cost);
scanf("%f",&percent);
printf("The price now is %6.2f",cost*percent );

这一题主要是做输入输出!