收藏 分享(赏)

c语言switch函数示例.txt

上传人:Marleyazariah 文档编号:21759321 上传时间:2024-04-22 格式:TXT 页数:1 大小:1.06KB
下载 相关 举报
c语言switch函数示例.txt_第1页
第1页 / 共1页
亲,该文档总共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);

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高中资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:文库网官方知乎号:文库网

经营许可证编号: 粤ICP备2021046453号世界地图

文库网官网©版权所有2025营业执照举报