1、 数据结构课程设计报告数据结构课程设计报告 题目题目: : 八皇后问题八皇后问题 活期储蓄账目管理系统活期储蓄账目管理系统 院院 系:系: 计算机工程学院计算机工程学院 专业班级:专业班级: 学学 号:号: 学生姓名:学生姓名: 指导教师:指导教师: 20122012 年年 2 2 月月 24 24 日日 数据结构课程设计任务书数据结构课程设计任务书 学院学院 计算机工程学院计算机工程学院 系系 信息与软件工程系信息与软件工程系 学 号 学生姓名 专业(班级) 设计题目 第一类:趣味问题之八皇后 第二类:活期储蓄帐目管理 设 计 技 术 参 数 第一类题目设计技术参数:头文件#include
2、“stdio.h“ 、#include“stdlib.h“ 调用的函数 void print(int n)、int find(int i,int k)、void place(int k,int n) 第 二 类 题 目 设 计 参 数 : 头 文 件 : #include #include #include #include #include 调用的函数:void makeId()开户、void login()用户登入、void deleteId()撤户 、 void withdrawal(user int qN; int cont=0; void print(int n) cont+; in
3、t i; printf(“第%2d 个解:“,cont); for(i=1;ich; switch(ch) case 1:makeId(); break; case 2:login(); break; case 3:deleteId(); break; case 4:exit(0); break; default: coutname; for(int i=0;ipassword1; coutpassword2; if(password1!=password2) flag=1; coutmoney; temp2.money=money; fp=fopen(file,“w“) ; if(fp=fo
4、pen(file,“r“)=NULL) coutname; if(fp=fopen(file,“r“)=NULL) /以读的方式打开文件 coutpassword2; if(flag=0) coutch; switch(ch) case 1:withdrawal(temp); break; case 2:deposit(temp); break; case 3:showMoney(temp); break; case 4:exit(0); break; default:coutname; coutpassword; if(fp=fopen(file,“r“)=NULL) coutmoney;
5、if(temp.moneymoney; temp.money=temp.money+money; cout“本次存款金额为:“moneyendl; cout“账 户 余 额 为:“temp.moneyendl; if(fp=fopen(file,“w“)=NULL) /以写的方式打开文件,覆盖原文件, 实现用户信息更新 cout“cannot open the file“endl; exit(-1); fwrite( /更新该用户取款后的数据 fclose(fp); getch(); /暂停功能,按任意键继续 /查询余额 void showMoney(user if(fp=fopen(file,“r“)=NULL) cout“cannot open the file“endl; exit(-1); cout“用户编号为:“temp.numendl; cout“用 户 名为:“temp.nameendl; cout“用户密码为:“temp.passwordendl; cout“用户余额为:“temp.moneyendl; fclose(fp); getch(); /暂停功能,按任意键继续