手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

正确使用C-free3.5教程

时间:2024-10-21 00:17:00

1、先打开C-free3.5编译器。

正确使用C-free3.5教程

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

正确使用C-free3.5教程

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

正确使用C-free3.5教程

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:320x=320.000000,price=272.000000Press any key to continue...

© 手抄报圈