例 main( ) { int i=10; switch(i) { case 9: i+=1; case 10: i+=1; case 11: i+=1; default: i+=1; } printf(“i=%d”,i); } i=13 例 main( ) { int a=1,b=0; switch(a) { case 1: switch(b) { case 0:printf(“**0**”);break; case 1:printf(“**1**”);break; } case 2:printf(“**2**”);break; } } **0****2** 分析:求解此方程的解,应该考虑到各种可能的情况: 当a=0时,不是二次方程。 否则: 1)当b2-4ac=0 时,方程有两个相等的实根。 2)当b2-4ac>0 时,方程有两个不相等的实根。 3)当b2-4ac<0 时,方程有两个共轭的复根。 选择分支结构程序举例 例. 求ax2+bx+c=0方程的解。 #include stdio.h #include math.h main()
您可能关注的文档
- Access数据库程序设计 课件 第1章 数据库基础.pptx
- Access数据库程序设计 课件 第2章 Access 2016入门.pptx
- Access数据库程序设计 课件 第3章 表.pptx
- Access数据库程序设计 课件 第4章 查询.pptx
- Access数据库程序设计 课件 第5章 窗体.pptx
- Access数据库程序设计 课件 第6章 报表.pptx
- Access数据库程序设计 课件 第7章 宏.pptx
- Access数据库程序设计 课件 第8章 模块与VBA程序设计.pptx
- C语言程序设计(慕课版)课件 Chapter6 复杂数据类型.ppt
- C语言程序设计(慕课版)课件 chapter7 文件.ppt
原创力文档

文档评论(0)