我是一个菜鸟,正在写一个银行管理系统,写了这么多总是有错误,运行不了,求大神指点下
#include<stdio.h>#include<string.h>
#include<stdlib.h>
#include<conio.h>
struct CCard
{
char card [20];
char password[7];
int flag;
float account;
};
int main()
{
struct CCard C1[5];
printf("\n\n-----------------------------------------------欢迎进入银行管理系统!---------------------------------------------------");
scanf("%s");
int n=0;
while(n)
{
printf("请输入相应编号进行以下操作:\n");
scanf("%d",&n);
printf("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
printf("\n-----------------------------------------------1.银行卡管理--------------------------------------------------------------");
printf("\n-----------------------------------------------2.银行卡登录--------------------------------------------------------------");
}
switch(n)
{
case 1:manage();break;
case 2:Winlogon();break;
case 3:exit(0);
default:printf("输入错误,请重新输入!\n");
}
return 0;
}
int winlogon();
{
int i=0;
printf("\n请输入您的卡号:");
gets("card C1[0]");
printf("\n请输入您的密码:");
while(++i <= 3)
{
gets("password c1[0]");
if(strcmp("card C1[0]","password C1[0]")==0)
{
printf("\n登陆成功,请输入相应编号进行以下操作:");
printf("\n------------------------------------------------1.存款---------------------------------------------------------------");
printf("\n------------------------------------------------2.取款---------------------------------------------------------------");
printf("\n------------------------------------------------3.转账---------------------------------------------------------------");
printf("\n------------------------------------------------4.余额查询-----------------------------------------------------------");
break;
}
switch(n)
{
case 1:drawmoney();break;
case 2:deposit();break;
case 3:transfer();break;
case 4:balance();break;
case 5:exit(0);
default:printf("输入错误,请重新输入!\n");
}
else
{
printf("用户名或密码错误,请重新输入!");
break;
}
if(i<3)
{
printf("\n请重新输入密码,你还有%d次机会",3-i);
}
else
{
printf("密码错误已超过三次,你的账户已被冻结!");
}
}
return 0;
}
int Manage();
{
char m[10]="mao123";
char input[10]={0};
printf("请输入管理员密码:");
gets(input);
if(strcmp(m,input)==0)
{
printf("\n登陆成功,请输入相应编号进行以下操作:");
printf("\n------------------------------------------------1.添加银行卡---------------------------------------------------------------");
printf("\n------------------------------------------------2.删除银行卡---------------------------------------------------------------");
printf("\n------------------------------------------------3.改密---------------------------------------------------------------");
printf("\n------------------------------------------------4.信息查询-----------------------------------------------------------");
}
switch(n)
{
case 1:open();break;
case 2:closing();break;
case 3:modify();break;
case 4:information();break;
case 5:exit(0);
default:printf("输入错误,请重新输入!\n");
}
else
{
printf("密码错误,请重新输入");
}
return o;
}
void drawmoney;
{
int Num;
printf("\n请输入存款金额:");
scanf("%d,&Num");
C1[0].account=C1[0].account+Num;
getchar();
printf("请把你的钱放到指定位置----");
}
void deposit;
{
char x;
printf(\n"请输入取款金额:");
scanf("%f",&x);
if(C1[0].account>=x)
C1[0].account=C1[0].account-x;
printf("请取走您的钱----");
else
printf("对不起,您的余额不足----");
}
void transfer();
{
char y;
printf("请输入需要转账的银行卡号:");
scanf("%c",&CCard);
printf(\n"请输入转账金额:");
scanf("%f",&y);
if(C1[0].account>y);
C1[0].account=C1[0].account-y;
C1[1].account=C1[1].account+y;
printf("恭喜您转账成功----");
else
printf("对不起,您的余额不足----");
}
void balance();
{
printf("您的银行卡余额剩余10000元----");
}
void open();
{
int z=3;
printf("\n请依次输入卡号,密码,余额");
scanf("%c,%d,%f",&C1[Z].card[15],&C1[z].password[6],&C1[Z].account);
printf("恭喜您开户成功");
}
void closing();
{
int z=4;
printf("\n请依次输入卡号,密码,余额");
scanf("%c,%d,%f",&C1[Z].card[15],&C1[z].password[6],&C1[Z].account);
printf("恭喜您销户成功");
}
void modify();
{
printf("请输入需要修改密码的银行卡号:");
scanf("%c",&C1[5].card);
printf("请输入旧密码:");
scanf("%d",&C1[5].password);
if(strcmp("card C1[5]","password C1[5]")==0)
printf("请输入新密码:");
printf("请再次输入:");
printf("修改成功,请牢记您的新密码!!!!");
}
void information();
{
printf("系统故障,对不起,请稍后打开-----");
}