while(xuanze!=3)
{
printf("欢迎使用ATM系统\n");
printf("请先开户或者设置\n");
printf("1设置\n");
printf("2登录\n");
printf("3退出\n");
scanf("%d",&xuanze);
if(xuanze!=1&&xuanze!=2&&xuanze!=3)
{
system("cls");
break;
}
if(xuanze==1)
{
printf("请设置卡号:");
scanf("%d",&id);
printf("请设置密码:");
scanf("%d",&cook);
printf("设置成功。\n");
system("pause");
system("cls");
continue;
}
if(xuanze==2)
{
while(count<=3)
{
printf("请输入卡号:");scanf("%d",&kahao);
printf("请输入密码:");scanf("%d",&mima);
system("cls");
count++;
if(kahao==id && mima==cook)
{
printf("1.查询\n");
printf("2.取款\n");
printf("3.转账\n");
printf("4.修改密码\n");
scanf("%d",&p);
if(p==1)
{
printf("您的余额为%d\n",money);
printf("按任意键返回...\n");
system("pause");
system("cls");
可以用goto语句
用while包起来啊,让二级菜单内部循环
二级菜单再加个返回一级菜单的项,选了就break出去
不要使用goto
能用goto解决的事情,while和if都能搞定
goto除了让你自己的代码变的乱七八糟,没有别的好处