|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- //出口条件循环
- #include <stdio.h>
- int main(void)
- {
- const int secret_code = 3;
- int code_entered;
- printf("To enter the triskaidekaphobia therapy club,\n");
- printf("please enter the secret code number: ");
- scanf("%d",&code_entered);
- while(code_entered != secret_code)
- {
- printf("To enter the triskaidekaphobia therapy club,\n");
- printf("please enter the secret code number: ");
- scanf("%d",&code_entered);
- }
- printf("Congratulations! You are cured!\n");
- getchar();
- getchar();
- return 0;
- }
复制代码
VS说,scanf()函数不安全,要么,你使用scanf_s()函数,要么,就继续使用不安全的scanf()函数。
如图,创建项目时候 取消勾选“ 安全开发生命周期(SDL)检查”,就可以使用scanf()了。网上还有很多方法:这里就不详细说了,地址如下:" http://jingyan.baidu.com/article/19020a0a39196e529d284239.html"
|
|