《C语言2000行代码程序.doc》由会员分享,可在线阅读,更多相关《C语言2000行代码程序.doc(12页珍藏版)》请在金锄头文库上搜索。
1、#include #include #include #include #include #define N 100 struct info char account30; char user100; long dsit; long pw; bankN;/* = 2011021232, ouyan, 10000, 892968 ;*/ void login(); void regist(); int menu(); int refer(); int deposit(); int withdraw(); int transfer(); int resetPW(); int judgePW(lon
2、g ps); /*flagI标记当前登录账户,flagN标记当前转账的账户*/ int flagI, flagN; int n = 0; main() int choice = -1; while(1) printf(tt=n); printf( 欢迎使用自助存取款系统 n); printf(n = n); printf( 1.登录 n); printf( 2.注册 n); printf( 3.退出 n); printf(n = n); printf(t* 请输入您的选择:); scanf(%d, &choice); switch(choice) case 1: system(cls); lo
3、gin(); break; case 2: system(cls); regist(); break; case 3: exit(0); break; default: printf(输入有误,请重输.n); break; /登录/ void login() int i; int flag = 0; char my_act100; long password; int X = -1; printf(tt=n);printf(tt=n); printf(tt=*登录*=n);printf(tt=n);printf(tt=n); printf(tt* 输入账户: ); scanf(%s, my_a
4、ct); /输入账户 printf(n); printf(tt* 输入密码: ); scanf(%ld, &password); /输入密码 for(i=0; iN; i+) if(strcmp(my_act, banki.account) = 0 & password = banki.pw) flagI = i; flag = 1; printf(tt登录成功,正在跳转页面.n); Sleep(2000); system(cls); while(1) X = menu();/成功进入 if(X = 1) system(cls); menu(); else return; else print
5、f(tt账号或密码错误,请重新输入.n); Sleep(2000); system(cls); return; /注册/ void regist() int i;printf(tt=n);printf(tt=n); printf(tt=*注册*=n); printf(tt=n);printf(tt=n); printf(tt请输入您的账户:n); printf(tt); scanf(%s, bankn.account); printf(tt请输入用户名:n); printf(tt); scanf(%s, bankn.user); printf(tt输入您的密码:n); printf(tt);
6、scanf(%ld, &bankn.pw); for(i=0; iN & i != n; i+) if(strcmp(bankn.account, banki.account) = 0) printf(tt账户已存在,请重新注册.n); n -= 1; Sleep(2000); system(cls); return; printf(tt注册成功n); bankn.dsit = 0; n+; Sleep(2000); system(cls); return; /主页面/ int menu() printf(tt=n);printf(tt=n); printf(tt=*主页面*=n); printf(tt=*=n); printf(tt* 1. 查询 n); printf(tt* 2. 存钱 n); printf(tt* 3. 取钱