c语言switch函数示例.txt
《c语言switch函数示例.txt》由会员分享,可在线阅读,更多相关《c语言switch函数示例.txt(1页珍藏版)》请在文库网上搜索。
#includemain()int t;printf();scanf(d%,&t);switch(t)case 1:printf(mondayn);case 2:printf(tuesdayn);case 3:printf(wednesdayn);default:printf(errorn);while(1);%#include void main( ) int x=1,y=0,a=0,b=0; switch(x) case 1: switch(y) case 0: a+; break; case 1: b+; break; case 2: a+;b+; break; case 3: a+;b+; printf(na=%d,b=%d,a,b); while(1); %#include void main() int c; printf(Enter m or n or h or other:); c=getchar(); switch(c) case m: printf( Good morning!n);break; case n: printf( Good night!n); break; case h: printf( Hello!n); break; default : printf( ?n); while(1);
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 语言 switch 函数 示例