正确使用C-free3.5教程
1、先打开C-free3.5编译器。

2、然后进入新建c语言的.cpp。

3、第三步进行输入源代码。我以
某商场为了促销,对购买200元以上的顾客优惠15%,对其他顾客优惠5%,编写程序为例子。完成后点击F11后。没有报错误或者警告后,点击F5运行。得到相应的结果了。

4、源代码:
#include "stdio.h"
main()
{
float x=0,price=0;
printf("Input x:");
scanf("%f",&x);
if(x>200) price=x*(1-0.15);
else price=x*(1-0.05);
printf("x=%2f,price=%2f\n",x,price);
}
运行结果:
Input x:320
x=320.000000,price=272.000000
Press any key to continue...
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:162
阅读量:162
阅读量:98
阅读量:139
阅读量:134