首页 行业资讯 宠物日常 宠物养护 宠物健康 宠物故事

C语言编写ATM机模拟系统

发布网友

我来回答

2个回答

热心网友

#include "stdarg.h"
#include "stdlib.h"
#include "stdio.h"
int number=0;
typedef struct myclass{
char *account;
char *password;
int num;
}mc;
char *inputpassword()
{int i;
char pass[50];
printf("\nplease input password:");
for (i=0;i<50;i++)
{pass[i]=getch();

if (pass[i]=='\r'|| pass[i]=='\n')
break;printf("*");}
return pass;
}

main()
{ mc mmclass[100];
char *username;
char key;
while(1)
{ printf("\n 1----create new account\n");
printf(" 2----quit");
printf("\n chooice:");
if ((key=getch())=='1')
{
printf("\nnplease input account:");
scanf("%s",username);
strcpy(mmclass[number].password,inputpassword());
strcpy(mmclass[number].account,username);
mmclass[number].num=0;
printf("\n created user success!!!");
number++;
printf("\n\n\n press anykey to continue");
getch();
}
else if (key=='2')
exit(0);
else
printf("\n\n input error");
}
}

热心网友

我写了,但是太常了,发布过来啊,,,我的可以,你用了再给我加分

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com