最近要交C语言大作业了,由于上学期时没好好学,现在很是后悔,希望有好心人帮帮我吧!!作业的要求如下:

学生信息管理系统设计学生信息包括:学号,姓名,年龄,性别,出生年月,地址,电话,E-mail等。提供以下功能:1、系统以菜单方式工作2、学生信息录入功能(学生信息用文件保... 学生信息管理系统设计
学生信息包括:学号,姓名,年龄,性别,出生年月,地址,电话,E-mail等。
提供以下功能:1、系统以菜单方式工作
2、学生信息录入功能(学生信息用文件保存)--输入
3、学生信息浏览功能--输出
4、学生信息查询功能--算法,按学号、姓名等查询
5、学生信息的删除与修改
此程序必须是能运行的,不要未完成的。如果哪位哥哥,姐姐之前的C语言大作业和我一样的话,希望速发给我最好附带实验报告。假如没有的话,也希望编程达人帮我编一个程序吧,小弟在这里跪求了。我的邮箱1959718853@qq.com
展开
 我来答
sdjyliqi
2011-06-17 · 超过27用户采纳过TA的回答
知道答主
回答量:90
采纳率:0%
帮助的人:24万
展开全部
本科时候的一个通信录管理,有你说的功能。完全可以运行。LZ看看吧。稍微加工一下就可以。
1 #include<iostream>
2 #include<string.h>
3 using namespace std;
4 struct Friend
5 {
6 double num;
7 string name;
8 char sex;
9 string telnum;
10 string addr;
11 Friend *next;
12 };
13 Friend *head;
14 Friend *Create ()
15 {
16 Friend *ps;
17 Friend *pEnd;
18 ps = new Friend;
19 cout << " 请你输入朋友的编号:" << endl;
20 cin>>ps->num;
21 cout << " 请你输入朋友的姓名:"<<endl;
22 cin>>ps->name;
23 cout << " 请你输入朋友的性别:"<<endl;
24 cin>>ps->sex;
25 cout << " 请你输入朋友电话:" << endl;
26 cin>>ps->telnum;
27 cout << " 请你输入朋友的地址:" << endl;
28 cin>>ps->addr;
29 head = ps;
30 pEnd = ps;
31 cout<<" 是否继续输入:继续按Y ,退出按N "<<endl;
32 char m;
33 cin>>m;
34
35 if(m=='y'||m=='n'||m=='Y'||m=='N')
36 {
37 while (m=='y'||m=='Y' )
38 {
39 ps = new Friend;
40 cout << " 请你输入朋友的编号:" << endl;
41 cin>>ps->num;
42 cout << " 请你输入朋友的姓名:"<<endl;
43 cin>>ps->name;
44 cout << " 请你输入朋友的性别:"<<endl;
45 cin>>ps->sex;
46 cout << " 请你输入朋友电话:" << endl;
47 cin>>ps->telnum;
48 cout << " 请你输入朋友的地址:" << endl;
49 cin>>ps->addr;
50 pEnd->next = ps;
51 pEnd = ps;
52 char n;
53 cout<<" 是否继续输入:继续按Y ,退出按N "<<endl;
54 cin>>n;
55 if(n!='y'&&n!='Y')
56 m='N';
57 else
58 m='y';
59 }
60 }
61 else
62 cout<<" 对不起,你输入了非法数据。"<<endl;
63 pEnd->next = NULL;
64 return (head);
65 }
66
67 void chaxun(int num1,string name1) //
68 { int r=0;
69 if(head==NULL)
70 {
71 r++;
72 cout<<" 对不起,没有你所查找的朋友:"<<endl;
73 return;
74 }
75
76 for (Friend * pGuard = head; pGuard; pGuard = pGuard->next)
77 {
78 if (pGuard->num==num1)
79 {
80 r++;
81 cout<<" 你查找的朋友信息是:"<<endl;
82 cout<<pGuard->num<<" "<<pGuard->name<<" "<<pGuard->sex<<" "<<pG
uard->telnum<<" "<<pGuard->addr<<endl;
83 }
84 if( pGuard->name==name1)
85 {
86 r++;
87 cout<<" 你查找的朋友信息是:"<<endl;
88 cout<<pGuard->num<<" "<<pGuard->name<<" "<<pGuard->sex<<" "<<pGua
rd->telnum<<" "<<pGuard->addr<<endl;
89 }
90 }
91 if(r==0)
92 cout<<" 对不起,你输入了错误信息"<<endl;
93 }
94
95 void Delete (int number)
96 {
97 Friend *p;
98 if (head == NULL)
99 {
100 cout << "对不起,没有你所查找的朋友:" << endl;
101 return;
102 }
103
104 if (head->num == number)
105 {
106 p = head;
107 head = head->next;
108 delete p; //**************
109 cout << " 待删除的朋友已删除" << endl;
110 return;
111 }
112
113 for (Friend * pGuard = head; pGuard->next; pGuard = pGuard->next)
114 {
115 if (pGuard->next->num == number)
116 {
117 p = pGuard->next;
118 pGuard->next = p->next;
119 delete p;
120 cout << number << " 号已经删除 " << endl;
121 return;
122 }
123 }
124 cout << number << " 号没有找到" << endl;
125 }
126 void insert (Friend * Node)
127 {
128 if (head == NULL)
129 {
130 head = Node;
131 Node->next = NULL;
132 return;
133 }
134 else if (head->num > Node->num)
135 {
136 Node->next = head;
137 head = Node;
138 return; //****************************
139 }
140 Friend *pGuard = head;
141 while (pGuard->next && pGuard->next->num < Node->num)
142 pGuard = pGuard->next;
143 Node->next = pGuard->next;
144 pGuard->next = Node;
145 return;
146 }
147 void showlist (Friend * dhead)
148 {
149 cout << "************" << endl;
150 while (dhead != NULL)
151 {
152 cout << dhead->num << " " << dhead->name << " " << dhead->sex<<
" " << dhead->telnum <<" "<<dhead->addr<<endl;
153 dhead = dhead->next;
154 cout << endl;
155 }
156 }
157 int main ()
158 {
159 char i2,i3;
160 head = Create ();
161 showlist (head);
162
163 int t=0;
164 for(int i=0;i<=t;i++)
165 {
166 int i;
167 cout<<" 通讯录查询请按 1"<<endl;
168 cout<<" 通讯录插入请按 2"<<endl;
169 cout<<" 通讯录删除请按 3"<<endl;
170 cout<<" 退出请按 4 "<<endl;
171 cin>>i;
172 while(i!=1&&i!=2&&i!=3&&i!=4)
173 {
174 cout<<" 你输入了非法数据,请重新输入"<<endl;
175 cin>>i;
176 }
177
178 if(i==1|i==2||i==3||i==4)
179 {
180 string strChoice;
181 if(i==1)
182 {
183 do
184 {
185 cout<<" 请选择查询的方式:编号1,姓名2 "<<endl;
186 int jj;
187 cin>>jj;
188 string name2; //name
189 if(jj==1)
200 string name2;
201 cout<<" 请输入待查询的姓名:"<<endl;
202 cin>>name2;
203 chaxun(-1,name2);
204 }
205 cout<<" 是否继续查询:继续按Y ,退出按N "<<endl;
206 cin>>strChoice;
207 } while (strChoice=="y"||strChoice=="Y");
208 }
209
210 if(i==2)
211 {
212 string strChoice2;
213 do
214 {
215 Friend *Node;
216 Node = new Friend;
217 cout << " 请你输入朋友的编号:" << endl;
218 cin>>Node->num;
219 cout << " 请你输入朋友的姓名:"<<endl;
220 cin>>Node->name;
221 cout << " 请你输入朋友的性别:"<<endl;
222 cin>>Node->sex;
223 cout << " 请你输入朋友电话:" << endl;
224 cin>>Node->telnum;
225 cout << " 请你输入朋友的地址:" << endl;
226 cin>>Node->addr;
227 insert (Node);
228 showlist (head);
229 cout<<" 是否继续插入信息:继续按Y ,退出按N"<<endl;
230 cin>>strChoice2;
231 } while(strChoice2=="y"||strChoice2=="Y");
232
233 }
234
235 if(i==3)
236 {
237 string strChoice3;
238 do
239 {
240 int i;
241 cout << " 请你输入待删除同学的编号 :" << endl;
242 cin >> i;
243 Delete (i);
244 showlist (head); //end
245 cout<<" 是否继续进行删除 继续按Y 退出按N "<<endl;
246 cin>>strChoice3;
247 } while(strChoice3=="y"||strChoice3=="Y");
248 }
249
250 if(i==1||i==2||i==3)
251 { char x;
252 cout<<" 是否继续进行操作 继续按Y 退出按N "<<endl;
253 cin>>x;
254 if(x=='y'||x=='Y')
255 t++;
256 }
257
258 }
259 }
260 }
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式