"修改例题的程序,在每一case语句之后增加break 语句, 使每一次执行之后均可跳出switch语句,从而避免输出不应有的结果。<br>【例4-10】#includeint main(void){ int a; printf(""input integer number: ""); scanf(""%d"",&a); switch (a){ case 1:printf(""Monday\n""); break; case 2:printf(""Tuesday\n""); break; case 3:printf(""Wednesday\n""); break; case 4:printf(""Thursday\n""); break; case 5:printf(""Friday\n""); break; case 6:printf(""Saturday\n""); break; case 7:printf(""Sunday\n""); break; default:printf(""error\n""); } return 0; }<br>在使用switch语句时还应注意以下几点:在case后的各常量表达式的值不能相同,否则会出现错误。在case后,允许有多个语句,可以不用{}括起来。各case和default子句的先后顺序可以变动,而不会影响程序执行结果。default子句可以省略不用。"
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。<br>版权<br>Follow the steps.<br>1. Press the win + R combination on your keyboard.<br>2. Type “control userpasswords2” then click on ok.<br>3. Make the UAC Affirmation.<br>4. Now switch to Users tab. Uncheck the option “Users must enter a user name and passwordto use this computer”.<br>5. Click on Apply. Now in Automatically sign in window type your password and confirm it.<br>6. Click on OK and that’s it. Now whenever you open windows, you will be automatically sign in.<br><img><br><img><br><img><br><img><br><img><br><img><br><img><br><img><br>收藏<br><img><br>一键三连<br><img><br>扫一扫,分享海报<br><img><br><img><br><img><br><img><br><img><br>运行命令:netplwiz 运行命令:regedit 在地址栏输入:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device 后回车 双击:DevicePasswordLessBuildVersion 把值改成0确定! 现在我们再进去就可以看到了 ...<br><img><br><img><br><img><br><img><br>