Visual Studio 2012显示调试断言失败

CSDN问答 2021-12-30 14:19:30 阅读数:645

调试 断言 显示 studio visual

代码如下
#include<stdio.h>
#define _CRT_SECURE_NO_DEPRECATE
void search();
void main()
{
int f;
printf(" ************************************************************\n");
printf("欢迎访问XX附属医院挂号系统!\nWelcome to Hohai University Hospital in Chang Zhou!\n");
printf("************************************************************\n");
printf("1.进入 2.退出\n1.Enter 2.Exit\n");
scanf_s("%d", &f); if (f == 1) search(); else
printf("感谢访问!\n Thanks for visit!\n");
}
void search()
{
int d[18], g[3], a, b, c, h;
printf("请选择您需要的服务:\n1.预约挂号\n2.退定预约\n1.make an appointment\n2.draw back an appointment\n");
scanf_s("%d", &a);
if (a > 2 || a < 1)
{
printf("您输入有误请您重试!\ninput error please try again!\n");
}
else switch (a)
{
case 1:
{
printf("请您输入您的18位身份证号码:\nplease input your ID(18 numbers):\n");
scanf_s("%d", &d[18]);
printf("您已登陆成功!\nLogin successful!\n");
printf("请您选择预约科室:\nPlease choose your reservation department:\n");
printf("1.外科\n2.内科\n3.五官科\n4.急诊科\n5.健康体检中心\n1.Surgery Dept\n2.Internal medicine Dept\n3.Ent\n4.Emergency Dept\n5.Health examination center\n"); scanf_s(" % d", &b);
switch (b)
{
case 1:
printf("请预交款为10元。\nPlease pay money for 10 yuan\n");
printf("1.确定 2.返回");
scanf_s("%d", &h);
printf("您已预约成功*预约号为15号\nSuccessful appointment*the number is 15\n"); break;
case 2:
printf("请预交款为12元。\nPlease pay money for 12 yuan\n");
printf("1.确定 2.返回");
scanf_s("%d", &h);
printf("您已预约成功*预约号为03号\nSuccessful appointment*the number is 03\n"); break;
case 3:
printf("请预交款为5元。\nPlease pay money for 5 yuan\n");
printf("1.确定 2.返回");
scanf_s("%d", &h);
printf("您已预约成功*预约号为08号\nSuccessful appointment*the number is 08\n"); break;
case 4:
printf("请预交款为8元。\nPlease pay money for 8 yuan\n");
printf("1.确定 2.返回");
scanf_s("%d", &h);
printf("您已预约成功*预约号为01号\nSuccessful appointment*the number is 01\n"); break;
case 5:
printf("请预交款为30元。\nPlease pay money for 30 yuan\n");
printf("1.确定 2.返回");
scanf_s("%d", &h);
printf("您已预约成功*预约号为23号\nSuccessful appointment*the number is 23\n"); break;
default:
printf("您的输入有错请您重试\ninput error please try again!\n");
}
}
break;
case 2:
{
printf("请您输入您的18位身份证号码:\nplease input your ID(18 numbers):\n");
scanf_s("%d", &d[18]);
printf("您已登陆成功!\nLogin successful!\n");
printf("请您选择退订预约科室:\nPlease choose unsubscribe reservation department:\n");
printf("1.外科 \n2.内科\n3.五官科\n4.急诊科\n5.健康体检中心\n1.Surgery Dept\n2.Internal medicine Dept\n3.Ent\n4.Emergency Dept\n5.Health examination center\n"); scanf_s(" % d", &c);
switch (c)
{
case 1:
printf("请您输入要退定的预约号码:\ninput the number:\n");
scanf_s("%d", &g[3]);
printf("我们将退您10元。\nWe will refund you 10 yuan.\n");
printf("您退定成功,谢谢您的光临 !\nThank you for your coming\n"); break;
case 2:
printf("请您输入要退定的预约号码:\ninput the number:\n");
scanf_s("%d", &g[3]); printf("我们将退您 12元。\nWe will refund you 12 yuan.\n");
printf("您退定成功,谢谢您的光临 !\nThank you for your coming\n"); break;
case 3:
printf("请您输入要退定的预约号码:\ninput the number : \n");
scanf_s(" % d", &g[3]);
printf("我们将退您5元。\nWe will refund you 5 yuan.\n");
printf("您退定成功,谢谢您的光临 !\nThank you for your coming\n"); break;
case 4:
printf("请您输入要退定的预约号码:\ninput the number : \n");
scanf_s("%d", &g[3]);
printf("我们将退您8元。\nWe will refund you 8 yuan.\n");
printf("您退定成功,谢谢您的光 临 !\nThank you for your coming\n"); break;
case 5:
printf("请您输入要退定的预约号码:\ninput the number : \n");
scanf_s(" % d", &g[3]);
printf("我们将退您30元。\nWe will refund you 30 yuan.\n");
printf("您退定成功,谢谢您的光临 !\nThank you for your coming\n"); break;
default:
printf("您的输入有 错请您重试\ninput error please try again!\n");
}
}
break;
}
{
int n;
printf("感谢光临!\n是否要再预约或退订预约? 1.是 2.否\nThank you for your coming!\nIf you want to make another appointment or rescind the appointment ? \n1.yes 2.no\n");
scanf_s("%d", &n);
if (n == 1)
search();
else;
}
printf("再见!\ngood bye!\n");
}
调试结果如图

版权声明:本文为[CSDN问答]所创,转载请带上原文链接,感谢。 https://ask.csdn.net/questions/7613289