运用switch语句实现选择效果
2013-02-12 17:44
253 查看
#include <stdio.h> int main() { void act1(int,int),act2(int,int); char ch; int a=2013,b=52; ch=getchar(); switch(ch) { case 'a': case 'A':act1(a,b);break; case 'b': case 'B':act2(a,b);break; default:putchar('\a'); //发出警告声音 } return 0; } void act1(int x,int y) { printf("%d\n",x+y); } void act2(int x,int y) { printf("%d\n",x*y); }
相关文章推荐
- JAVA-练习MyShopping实现商品换购 综合运用嵌套if选择结构 switch选择结构 多重if选择 结构实现商品换购功能
- switch语句实现多分支选择结构
- 多分支选择结构与switch语句的运用.cpp
- JS 特效 用js实现radio选择钮效果
- jQuery实现非常实用漂亮的select下拉菜单选择效果
- 自定义Gallery实现QQ附近的人和京东金融选择存款时间效果
- 商品SKU选择实现效果
- jQuery实现Table表格隔行变色及高亮显示当前选择行效果示例
- java语法基础-程序流程控制-选择结构-switch语句
- 《C语言及程序设计》程序阅读——用switch语句实现多分支结构
- js实现仿阿里巴巴城市选择框效果实例
- JSON+HTML实现国家省市联动选择效果
- JS中switch语句做选择时为什么可以不用break?
- 微信小程序实现topBar底部选择栏效果
- listview中内嵌gridview实现子菜单选择效果
- SQL面试题: 数据库中有A B C三列,用SQL语句实现:当A列大于B列时选择A列否则选择B列 ,当B列大于C列时选择B列否则选择C列 ,
- JQ实现效果:奇偶行颜色不同,单项选择和多项选择
- Android自定义控件实现按钮滚动选择效果
- CSS3target伪类元素选择实现类似灯箱效果
- jquery实现商品拖动选择效果代码(自写)