这个(简单的银行管理系统)程序代码我始终不能运行、、我感觉是不能调用自己定义的函数、、请各位指点下、、
#include<stdio.h>#include<stdlib.h>
#include<string.h>
#include<windows.h>
int n=0,m;
struct Person
{
char name[100];
char number[100];
char workplace[100];
char address[100];
float money;
char kahao[100];
char mina[100];
}person[100];
void menu();
void kaihu();
void zimenu();
void denglu();
void cunkuan();
void qukuan();
void xiaohu();
void xiugaixinxi();
void banka();
void guashika();
void chaxun();
void error();
void menu()
{
int choice=0;
sytem("cls");
printf("\t\t**********************************************\n");
printf("\t\t* 选择操作命令 *\n");
printf("\t\t* 1.开户 *\n");
printf("\t\t* 2.已开户登录 *\n");
printf("\t\t* 3.退出 *\n");
printf("\t\t**********************************************\n");
scanf("%d",choice);
switch(choice)
{
case 1:kaihu();break;
case 2:denglu();break;
case 3:exit();break;
error();}
}
void kaihu()
{
int i;
system("cls");
char name[100];
printf("\t\t**********************************************\n");
printf("\t\t* 请输入姓名 *\n");
printf("\t\t**********************************************\n");
scanf("%s",&name);
for(i=0;i<=n;i++)
{
if(strcmp(name,person[i].name)==0)
{
printf("\t\t**********************************************\n");
printf("\t\t* 户名重复 *\n");
printf("\t\t**********************************************\n");
strcpy(person[n+1].name,name);
printf("\t\t**********************************************\n");
printf("\t\t* 请输入密码 *\n");
printf("\t\t**********************************************\n");
scanf("%s",&person[n+1].mima);
printf("\t\t**********************************************\n");
printf("\t\t* 请输入工作单位 *\n");
printf("\t\t**********************************************\n");
sacnf("%s",&person[n+1].workplace);
printf("\t\t**********************************************\n");
printf("\t\t* 请输入家庭地址 *\n");
printf("\t\t**********************************************\n");
sacnf("%s",&person[n+1].address);
printf("\t\t**********************************************\n");
printf("\t\t* 请输入身份证号码 *\n");
printf("\t\t**********************************************\n");
scanf("%s".&person[n+1]);
printf("\t\t**********************************************\n");
printf("\t\t* 开户成功 *\n");
printf("\t\t* 按任意键返回 *\n");
printf("\t\t**********************************************\n");
n++;
getchar();getchar();
menu();
}
void denglu()
{
char name[100];
char mima[100];
int i;
system("cls");
printf("\t\t**********************************************\n");
printf("\t\t* 请输入姓名 *\n");
printf("\t\t**********************************************\n");
scanf("%s",&name);
for(i=1;i<=n;i++)
{
if(strcmp(person[i].name,name)==0)
{
printf("\t\t**********************************************\n");
printf("\t\t* 请输入密码 *\n");
printf("\t\t**********************************************\n");
scanf("%s",&mima);
if(strcmp(person[i].mima,mima)==0)
zimenu();
else
{
error();
}
}
else
{
error();
}
}
}
void zimenu()
{
int choose=0;
system("cls");
printf("\t\t**********************************************\n");
printf("\t\t* 请选择操作命令 *\n");
printf("\t\t* 1.存款 *\n");
printf("\t\t* 2.取款 *\n");
printf("\t\t* 3.销户 *\n");
printf("\t\t* 4.修改信息 *\n");
printf("\t\t* 5.办卡 *\n");
printf("\t\t* 6.挂失卡 *\n");
printf("\t\t* 7.余额查询 *\n");
printf("\t\t* 8.返回 *\n");
printf("\t\t**********************************************\n");
scanf("%f",&choose);
switch(choose)
{
case 1:cunkaun();break;
case 2:cunkaun();break;
case 3:qukaun();break;
case 4:xiaohu();break;
case 5:xiugaixinxi();break;
case 6:banka();break;
case 7:guashika();break;
case 8:menu();break;
error();
}
}
void cunkuan()
{
float money;
system("cls");
printf("\t\t**********************************************\n");
printf("\t\t* 请输入存款金额 *\n");
printf("\t\t**********************************************\n");
scanf("%f",&money);
if(money>0)
{
person[n].money+=money;
printf("\t\t**********************************************\n");
printf("\t\t* 存款金额 *\n");
printf("\t\t* 按任意键返回 *\n");
printf("\t\t**********************************************\n");
getchar();getchar();
zimenu();
}
else
error();
}
void qukuan()
{
float money;
system ("cls");
printf("\t\t**********************************************\n");
printf("\t\t* 请输入取款金额 *\n");
printf("\t\t**********************************************\n\n");
scanf("%f",&money);
if(money>0)
{
person[n].money-=money;
if(person[n].money<0.0)
{printf("\t\t**********************************************\n");
printf("\t\t* 余额不足 *\n");
printf("\t\t* 按任意键返回 *\n");
printf("\t\t**********************************************\n\n");
getchar();getchar();
zimenu();
}
else
{printf("\t\t**********************************************\n");
printf("\t\t* 取款成功 *\n");
printf("\t\t* 按任意键返回 *\n");
printf("\t\t**********************************************\n\n");
getchar();getchar();
zimenu();
}
}
else
error();
}
void xiaohu()
{char name[100];
char mima[100];
int i,j;
system("cls");
printf("\t\t**********************************************\n");
printf("\t\t* 请输入户名 *\n");
printf("\t\t**********************************************\n\n");
scanf("%s",&name);
for(i=0;i<=n;i++)
{
if(strcmp(person[i].name,name)==0)
{
printf("\t\t**********************************************\n");
printf("\t\t* 请输入密码 *\n");
printf("\t\t**********************************************\n\n");
scanf("%s,"&mima);
if(strcmp(person[i].mima,mima)==0)
{
for(j=i;j<=n;j++)
person[j]=person[j+1];
printf("\t\t**********************************************\n");
printf("\t\t* 销户成功 *\n");
printf("\t\t* 按任意键返回 *\n");
printf("\t\t**********************************************\n\n");
n--;
getchar();getchar();
zimenu();
}
else
{
error();
}
}
}
printf("\t\t**********************************************\n");
printf("\t\t* 没有您要销户的户名 *\n");
printf("\t\t* 按任意键返回 *\n");
printf("\t\t**********************************************\n\n");
getchar();getchar();
zimenu();
}
void xiugaixinxi()
{
system("cls");
printf("\t\t**********************************************\n");
printf("\t\t* 请输入修改后的户名 *\n");
printf("\t\t**********************************************\n\n");
scanf("%s",&person[n].name);
printf("\t\t**********************************************\n");
printf("\t\t* 请输入修改后的密码 *\n");
printf("\t\t**********************************************\n\n");
scanf("%s",&person[n].mima);
\printf("\t\t**********************************************\n");
printf("\t\t* 请输入修改后的身份证号码 *\n");
printf("\t\t**********************************************\n\n");
scanf("%s",&person[n].number);
printf("\t\t**********************************************\n");
printf("\t\t* 请输入修改后的工作单位 *\n");
printf("\t\t**********************************************\n\n");
scanf("%s",&person[n].workplace);
printf("\t\t**********************************************\n");
printf("\t\t* 请输入修改后的家庭住址 *\n");
printf("\t\t**********************************************\n\n");
scanf("%s",&person[n].address);
printf("\t\t**********************************************\n");
printf("\t\t* 修改成功 *\n");
printf("\t\t* 按任意键返回 *\n");
printf("\t\t**********************************************\n\n");
getchar();getchar();
zimenu();
return;
}
void banka()
{
int i;
char kahao[100];
system("cls");
printf("\t\t**********************************************\n");
printf("\t\t* 请输入卡号 *\n");
printf("\t\t**********************************************\n\n");
scanf("%s",&kahao);
for(i=0;i<=n;i++)
{
if(strcmp(kahao,person[i].kahao==0)
{
printf("\t\t**********************************************\n");
printf("\t\t* 卡号重复 *\n");
printf("\t\t**********************************************\n\n");
getchar();getchar();
zimenu();
return;
}
}
strcpy(person[n].kahao,kahao);
printf("\t\t**********************************************\n");
printf("\t\t* 请输入密码 *\n");
printf("\t\t**********************************************\n\n");
scanf("%s",&person[n].mima);
printf("\t\t**********************************************\n");
printf("\t\t* 办卡成功 *\n");
printf("\t\t* 按任意键返回 *\n");
printf("\t\t**********************************************\n\n");
getchar();getchar();
zimenu();
}
void guashika()
{
char kahao[100];
char mima[100];
int i,j;
system("cls");
printf("\t\t**********************************************\n");
printf("\t\t* 请输入要挂失的卡号 *\n");
printf("\t\t**********************************************\n\n");
scanf("%s",&kahao);
for(i=0;i<=n;i++)
{
if(strcmp(person[i].kahao,kahao)==0)
{
printf("\t\t**********************************************\n");
printf("\t\t* 请输入密码 *\n");
printf("\t\t**********************************************\n\n");
scanf("%s",&mima);
if(strcmp(person[n].mima,mima)==0)
{
for(j=0;j<=n;j++)
person[j]=person[j+1];
printf("\t\t**********************************************\n");
printf("\t\t* 挂失成功 *\n");
printf("\t\t* 按任意键返回 *\n");
printf("\t\t**********************************************\n\n");
n--;
getchar();getchar();
zimenu();
}
else
{
error();
}
}
}
printf("\t\t**********************************************\n");
printf("\t\t* 没有你所要挂失的号 *\n");
printf("\t\t* 按任意键返回 *\n");
printf("\t\t**********************************************\n\n");
getchar();getchar()
zimemi();
}
void chaxun()
{
system("cls");
printf("\t\t**********************************************\n");
printf("\t\t* 你卡上的余额为%f*\n".person[n].money);
printf("\t\t**********************************************\n\n");
printf("\t\t**********************************************\n");
printf("\t\t* 按任意键返回 *\n");
printf("\t\t**********************************************\n");
getchar();getchar():
zimenu();
}
viod error()
{
system("cls");
printf("\t\t**********************************************\n");
printf("\t\t* 输入错误,请重新输入 *\n");
printf("\t\t* 按任意键返回 *\n");
printf("\t\t**********************************************\n");
getchar();getchar();
manu();
}
void main()
{
menu();
}