求助,运行数据变成4368768
#include<stdio.h>#include<string.h>
#include<stdlib.h>
#define ZHANGHUSHU 20
#define JIAOYISHU 20
struct JY
{float jine;
float yue;
char leixing[20];
int year;
int month;
int day;
};
struct ZH
{char zhanghao[15];
char zhanghuming[5];
int jiaoyicishu;
struct JY jiaoyi[JIAOYISHU];
}zhanghu[ZHANGHUSHU];
int xuhao=0;
void xianshicaidan();
void xinjianzhanghu();
void cunqian();
void xianshicaidan()
{int a;
printf("\t\tATM主菜单\n1.新建账户\t2.存钱 \t3.取钱 \n4.查询 \t5.转账 \n");
printf("请输入序号进行操作!\n");
scanf("%d",&a);
switch(a){
case 1:xinjianzhanghu();break;//新建账户
case 2:cunqian();break;//存钱
case 3: ;
case 4: ;
case 5: ;
default:printf("输入错误,请重新输入!");}
}
void xinjianzhanghu()
{
printf("请输入账号:");
scanf("%s",zhanghu[xuhao].zhanghao);
printf("请输入账户名:");
scanf("%s",zhanghu[xuhao].zhanghuming);
printf("请输入账户余额:");
scanf("%d",&zhanghu[xuhao].jiaoyi[0].yue);
zhanghu[xuhao].jiaoyicishu=0;
zhanghu[xuhao].jiaoyi[0].jine=0;
strcpy(zhanghu[xuhao].jiaoyi[0].leixing,"新建账户");
xuhao++;
printf("这是第%d个账号\n",&xuhao);
}
void cunqian()
{int i,b;
float j;
char z[15];
char m[5];
printf("请输入账号");
scanf("%s",z);
for(i=0;i<xuhao;i++)
if(strcmp(zhanghu[i].zhanghao,z)==0){printf("请输入账户名");
scanf("%s",m);
if(strcmp(zhanghu[i].zhanghuming,m)==0){
printf("请输入存入金额");
scanf("%d",&j);
b=++zhanghu[i].jiaoyicishu;
zhanghu[i].jiaoyi[b].yue+=j;
zhanghu[i].jiaoyi[b].jine=j;
strcpy(zhanghu[i].jiaoyi[b].leixing,"存入");
printf("请输入日期(格式:年/月/日)");
scanf("%d/%d/%d",&zhanghu[i].jiaoyi[b].year,
&zhanghu[i].jiaoyi[b].month,
&zhanghu[i].jiaoyi[b].day);}
else {printf("请重新输入");return;}
}
else {printf("请重新输入");return;}
}
int main()
{
xianshicaidan();
return 0;
}