第5章例5-8
2013-10-04 09:26
211 查看
#include<stdio.h> float cash; int main(void) { int choice; float value; void income(float number),expend(float number); cash = 0; printf("Enter operate choice(0--end,1--income,2--expend):"); scanf("%d",&choice); while(choice!=0){ if(choice==1||choice==2){ printf("Enter cash value:"); scanf("%f",&value); if(choice==1) income(value); else expend(value); printf("current cash:%.2f\n",cash); } printf("Enter operate choice(0--end,1--income,2--expend):"); scanf("%d",&choice); } return 0; } void income(float number) { cash=cash + number; } void expend(float number) { cash=cash-number; }
![](http://images.cnitblog.com/blog/571388/201310/04092606-3f406ec109ea492ab92e65bf10a21bb8.jpg)
相关文章推荐
- 高质量C++/C编程指南 - 第5章 常量
- 第5章:隐藏具体实现
- 读书笔记-高质量C++/C编程指南-第5章 常量
- Oracle 9i & 10g编程艺术-深入数据库体系结构——第5章:Oracle进程
- 《Programming WPF》翻译 第5章 8.我们进行到哪里了?
- 第5章 jsp和el
- 《Erlang程序设计》学习笔记-第5章 顺序型编程进阶
- 第5章 基础——5.7. 进制.1
- 《虚拟化与云计算》第5章 云计算概论
- 《WCF技术内幕》翻译23:第2部分_第5章_消息:XmlDictionaryReader和回到Message
- 《WCF技术内幕》翻译30:第2部分_第5章_消息:复制消息、消息清理和本章小结
- 第5章 数据库完整性(数据库系统概论)
- 第5章_1_办公软件文字处理Aimin.rar
- 第5章 角色(用户组)管理
- Java标准教程:Java 2D绘图--第5章 使用图像
- 第5章总结
- 第5章类和对象(一)
- 《敏捷无敌》试读:第5章 成长的烦恼
- 第Ⅰ部分 敏捷开发 第5章 重构
- java笔记:第5章 数组