| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 614 人关注过本帖
标题:这个(简单的银行管理系统)程序代码我始终不能运行、、我感觉是不能调用自 ...
只看楼主 加入收藏
feng9239
Rank: 2
等 级:论坛游民
帖 子:7
专家分:11
注 册:2011-5-28
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:2 
这个(简单的银行管理系统)程序代码我始终不能运行、、我感觉是不能调用自己定义的函数、、请各位指点下、、
#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();
}

搜索更多相关主题的帖子: 银行 money person 管理系统 
2011-05-30 10:07
liangjinchao
Rank: 7Rank: 7Rank: 7
等 级:黑侠
帖 子:376
专家分:697
注 册:2010-11-8
收藏
得分:20 
无注释!

因为有了因为,所以有了所以,既然已成既然,何必再说何必
2011-05-30 12:08
feng9239
Rank: 2
等 级:论坛游民
帖 子:7
专家分:11
注 册:2011-5-28
收藏
得分:0 
你的回答我不懂哎、、、我不会改、、、能帮我改下不、、、谢谢
2011-05-30 17:22
快速回复:这个(简单的银行管理系统)程序代码我始终不能运行、、我感觉是不能调 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018874 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved