通讯录管理系统
实现了通讯录的录入信息、保存信息、插入、删除、排序、查找、单个显示等功能。。
完整的代码如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
|
#include <stdio.h>
#include <malloc.h> //得到指向大小为Size的内存区域的首字节的指针//
#include <string.h>
#include <stdlib.h> //标准库函数//
#define NULL 0
#define LEN sizeof(struct address_list) //计算字节//
int n;
struct address_list
{
char name[30]; //名字
char work[30]; //职业
char handset[30]; //手机
char email[30]; //电子邮件
char address[30]; //通讯地址
struct address_list *next;
};
struct address_list *shifang( struct address_list *head); // 释放内存函数声明
//创建函数,不带头结点的链表
struct address_list *creat( void )
{
struct address_list *head,*p1,*p2;
char name[20];
n=0;
p1=( struct address_list *) malloc (LEN);
p2=p1; //强制内存转换
printf ( "请输入通讯录的内容!\n姓名输入为0时表示创建完毕!\n" );
printf ( "请输入姓名:" );
gets (name);
if ( strcmp (name, "0" )!=0)
{
strcpy (p1->name,name);
printf ( "请输入职业:" ); gets (p1->work);
printf ( "请输入手机:" ); gets (p1->handset);
printf ( "请输入电子邮件:" ); gets (p1->email);
printf ( "请输入通讯地址:" ); gets (p1->address);
head=NULL;
while (1)
{
n=n+1; //记录通讯录人数个数
if (n==1)
head=p1;
else
p2->next=p1;
p2=p1;
printf ( "请输入姓名:" );
gets (name);
if ( strcmp (name, "0" )==0)
{
break ;
}
else
{
p1=( struct address_list *) malloc (LEN);
strcpy (p1->name,name);
printf ( "请输入职业:" ); gets (p1->work);
printf ( "请输入手机:" ); gets (p1->handset);
printf ( "请输入电子邮件:" ); gets (p1->email);
printf ( "请输入通讯地址:" ); gets (p1->address);
}
}
p2->next=NULL;
return head;
}
else
return 0;
}
//输出函数
void print( struct address_list *head)
{
struct address_list *p;
if (head!=NULL)
{
p=head;
printf ( "本通讯录现在共有%d人:\n" ,n);
printf ( "---姓名-------职业--------手机-------Email-------通讯地址\n" );
printf ( "==================================\n" );
do
{
printf ( "== %s" ,p->name); printf ( " " );
printf ( "%s" ,p->work); printf ( " " );
printf ( "%s" ,p->handset); printf ( " " );
printf ( "%s" ,p->email); printf ( " " );
printf ( "%s" ,p->address); printf ( " \n" );
p=p->next;
} while (p!=NULL);
printf ( "==================================\n" );
}
else
printf ( "通讯录为空,无法输出!\n" );
}
//增加函数
struct address_list *insert( struct address_list *head)
{
struct address_list *p0,*p1,*p2;
char name[20];
p1=head;
printf ( "请输入增加的内容:\n" );
printf ( "请输入姓名:" ); gets (name);
if ( strcmp (name, "0" )==0)
{
printf ( "姓名不能为0,增加失败!\n" );
return (head);
}
else
{
p0=( struct address_list *) malloc (LEN);
strcpy (p0->name,name);
printf ( "请输入职业:" ); gets (p0->work);
printf ( "请输入手机:" ); gets (p0->handset);
printf ( "请输入电子邮件:" ); gets (p0->email);
printf ( "请输入通讯地址:" ); gets (p0->address);
n=n+1;
if (head==NULL)
{
head=p0;
p0->next=NULL;
return head;
}
else
{
while ( strcmp (p0->name,p1->name)>0&&(p1->next!=NULL))
{
p2=p1;
p1=p1->next;
}
if ( strcmp (p0->name,p1->name)<0 || strcmp (p0->name,p1->name)==0)
{
if (head==p1)
{
head=p0;
}
else
{
p2->next=p0;
}
p0->next=p1;
}
else
{
p1->next=p0;
p0->next=NULL;
}
return head;
}
}
}
struct address_list* delete_txl( struct address_list *head)
{
struct address_list *p,*q;
char name[30];
if (head==NULL)
{
printf ( "通讯录为空,无法显示!\n" );
return head;
}
p=head;
printf ( "请输入需要删除的人的姓名:" );
gets (name);
if ( strcmp (head->name,name)==0)
{
head=head->next;
free (p);
printf ( "删除操作成功!\n" );
return head;
}
else
{
q=head,p=head->next;
while (p!=NULL)
{
if ( strcmp (p->name,name)==0)
{
q->next=p->next;
free (p);
printf ( "删除操作成功!\n" );
return head;
}
p=p->next;
q=q->next;
}
}
}
//显示函数
struct address_list *display( struct address_list *head)
{
struct address_list *p1,*p2;
char name[30];
int m;
if (head==NULL)
{
printf ( "通讯录为空,无法显示!\n" );
return head;
}
p1=head;
m=0;
printf ( "请输入需要显示人的姓名:" );
gets (name);
while (p1!=NULL)
{
while (( strcmp (p1->name,name))!=0 && p1->next!=NULL)
{
p2=p1;
p1=p1->next;
}
if ( strcmp (p1->name,name)==0)
{
m++;
printf ( "%s的通讯内容如下:\n" ,name);
printf ( "---姓名--------职业--------手机-------Email------通讯地址\n" );
printf ( "==================================\n" );
printf ( "== %s" ,p1->name); printf ( " " );
printf ( "%s" ,p1->work); printf ( " " );
printf ( "%s" ,p1->handset); printf ( " " );
printf ( "%s" ,p1->email); printf ( " " );
printf ( "%s" ,p1->address); printf ( " \n" );
printf ( "==================================\n" );
}
p1=p1->next;
}
if (m==0)
{
printf ( "此人未在本通讯录中!\n" );
}
return (head);
}
//排序函数
struct address_list *paixu( struct address_list *head)
{
struct address_list *p1,*p2;
int i,j;
struct address_list1
{
char name[30];
char work[30];
char handset[30];
char email[30];
char address[30];
};
struct address_list1 px[200];
struct address_list1 temp;
if (head==NULL)
{
printf ( "通讯录为空,无法排序!\n" );
return (head);
}
p1=head;
for (i=0;i<n,p1!=NULL;i++)
{
strcpy (px[i].name,p1->name);
strcpy (px[i].work,p1->work);
strcpy (px[i].handset,p1->handset);
strcpy (px[i].email,p1->email);
strcpy (px[i].address,p1->address);
p2=p1;
p1=p1->next;
}
head=shifang(head);
for (j=0;j<n-1;j++)
{
for (i=j+1;i<n;i++)
{
if ( strcmp (px[i].name,px[j].name)<0)
{
temp=px[i];
px[i]=px[j];
px[j]=temp;
}
}
}
p1=( struct address_list *) malloc (LEN);
p2=p1;
strcpy (p1->name,px[0].name);
strcpy (p1->work,px[0].work);
strcpy (p1->handset,px[0].handset);
strcpy (p1->email,px[0].email);
strcpy (p1->address,px[0].address);
head=p1;
for (i=1;i<n;i++)
{
p1=( struct address_list *) malloc (LEN);
strcpy (p1->name,px[i].name);
strcpy (p1->work,px[i].work);
strcpy (p1->handset,px[i].handset);
strcpy (p1->email,px[i].email);
strcpy (p1->address,px[i].address);
p2->next=p1;
p2=p1;
}
p2->next=NULL;
printf ( "按姓名排序后为:\n" );
print(head);
return (head);
}
//姓名查找函数
struct address_list *search( struct address_list *head)
{
struct address_list *p1,*p2;
int m;
char name[30];
if (head==NULL)
{
printf ( "通讯录为空,无法分类查找!\n" );
return (head);
}
p1=head;
printf ( "********************\n" );
printf ( "** 请输入需要查找的姓名 **\n" );
printf ( "********************\n" );
m=0;
gets (name);
while (p1!=NULL)
{
while ( strcmp (p1->name,name)!=0&&p1->next!=NULL)
{
p2=p1;
p1=p1->next;
}
if ( strcmp (p1->name,name)==0)
{
m++;
printf ( "你查找的内容是:\n" );
printf ( "+++++++++++++++++++++++++++++++++++\n" );
printf ( "++ %s %s %s %s %s\n" ,p1->name,p1->work,p1->handset,p1->email,p1->address);
printf ( "+++++++++++++++++++++++++++++++++++\n" );
}
p1=p1->next;
if (m==0)
{
printf ( "此人未在本通讯录中!\n" );
}
break ;
}
return (head);
}
//释放内存函数
struct address_list *shifang( struct address_list *head)
{
struct address_list *p1;
while (head!=NULL)
{
p1=head;
head=head->next;
free (p1);
}
return (head);
}
//文件写入函数
void save( struct address_list *head)
{
FILE *fp;
struct address_list *p1;
char tong[30];
if (head==NULL)
{
printf ( "通讯录为空,无法存储!\n" );
return ;
}
printf ( "请输入保存后的文件名:" );
gets (tong);
fp= fopen ( "(tong).txt" , "w" );
if (fp==NULL)
{
printf ( "cannot open file\n" );
return ;
}
p1=head;
fprintf (fp, "姓名 职业 手机 Email 通讯地址\n" );
for (;p1!=NULL;)
{
fprintf (fp, "%s %s %s %s %s\n" ,p1->name,p1->work,p1->handset,p1->email,p1->address);
p1=p1->next;
}
printf ( "保存完毕!\n" );
fclose (fp);
}
//文件读出函数
struct address_list *load( struct address_list *head)
{
FILE *fp;
char tong[30];
struct address_list *p1,*p2;
printf ( "请输入要输出的文件名:" );
gets (tong);
fp= fopen ( "(tong).txt" , "r" );
if (fp==NULL)
{
printf ( "此通讯录名不存在,无法输出!\n" );
return (head);
}
else
{
head=shifang(head);
}
p1=( struct address_list *) malloc (LEN);
fscanf (fp, "%s%s%s%s%s" ,&p1->name,&p1->work,&p1->handset,&p1->email,&p1->address);
if ( feof (fp)!=0)
{
printf ( "文件为空,无法打开!\n" );
return (head);
}
else
{
rewind (fp);
p2=p1;
head=p1;
n=0;
while ( feof (fp)==0)
{
fscanf (fp, "%s%s%s%s%s" ,&p1->name,&p1->work,&p1->handset,&p1->email,&p1->address);
if ( feof (fp)!=0)
break ;
p2->next=p1;
p2=p1;
p1=( struct address_list *) malloc (LEN);
n=n+1;
}
p2->next=NULL;
p1=head;
head=head->next;
n=n-1;
free (p1);
print(head);
printf ( "打开完毕!\n" );
return (head);
}
fclose (fp);
}
//综合操作函数
struct address_list *menu( struct address_list *head)
{
char num[10];
while (1)
{
printf ( "*********************\n" );
printf ( "*** 1 姓名查找 ****\n" );
printf ( "*** 2 单个显示 ****\n" );
printf ( "*** 3 增加 ****\n" );
printf ( "*** 4 退出 ****\n" );
printf ( "*********************\n" );
printf ( "请输入您选择的操作:" );
gets (num);
switch (*num)
{
case '1' :
{
head=search(head); //姓名查找
print(head);
}
break ;
case '2' :
{
head=display(head); //显示
}
break ;
case '3' :
{
head=insert(head); //增加
print(head);
}
break ;
case '4' :
return head;
default :
printf ( "操作错误,此项不存在!\n" );
break ;
}
if ( strcmp (num, "6" )==0)
break ;
}
return head;
}
//主函数
void main()
{
struct address_list *head=NULL;
char num[10];
printf ( "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n" );
printf ( "*=* 程序说明 *=*\n" );
printf ( "*=* 请及时保存创建完毕的通讯录内容! *=*\n" );
printf ( "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n" );
while (1)
{
printf ( "************************\n" );
printf ( "*** 1 创建通讯录 ****\n" );
printf ( "*** 2 按名字排序 ****\n" );
printf ( "*** 3 综合操作 ****\n" );
printf ( "*** 4 保存 ****\n" );
printf ( "*** 5 打开 ****\n" );
printf ( "*** 6 删除 ****\n" );
printf ( "*** 7 退出 ****\n" );
printf ( "************************\n" );
printf ( "请输入您选择的操作:" );
gets (num);
switch (*num)
{
case '1' :
{
if (head==NULL)
{
head=creat(); //创建
print(head);
}
else
{
head=shifang(head);
head=creat(); //重新创建
print(head);
}
}
break ;
case '2' :
{
head=paixu(head); //排序
}
break ;
case '3' :
{
head=menu(head); //综合操作
}
break ;
case '4' :
{
save(head); //文件保存
print(head);
}
break ;
case '5' :
{
head=load(head); //文件输出
}
break ;
case '6' :
{
head=delete_txl(head); //删除
print(head);
}
break ;
case '7' :
head=shifang(head);
break ;
default :
printf ( "操作错误,此项不存在!\n" );
break ;
}
if ( strcmp (num, "7" )==0)
break ;
}
}
|
歌厅歌曲管理系统
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
#include "stdlib.h"
#include "stdio.h"
#define MAX 100
typedef struct
{
int s[MAX][MAX]; //用二维数组存放教师专业特长
int D[MAX]; //用一维数组存放安排的教学任务
}MGraph;
MGraph G;
int creat( int *k, int n) //初始化,将二维数组s和一维数组D的adj全部赋值为0
{
int i,j;
for (i=1;i<=n;i++)
{
G.D[i]=0;
k[i]=0;
for (j=1;j<=n;j++)
G.s[i][j]=0;
}
printf ( "/n" );
printf ( "科目数成功确定为 %d/n" ,n);
return 1;
}
int techer_speciality( int n)
{
int k,i;
printf ( "请输入教师专业特长编号(1-%d) 0表示结束输入:/n" ,n);
for (i=1;i<=n;i++)
{
printf ( "输入教师编号为 %d 的特长专业号:" ,i);
do
{
scanf ( "%d" ,&k);
if (k>n)
{
printf ( "超出范围,重新输入: " );
continue ;
}
else
G.s[i][k]=1;
} while (k);
}
printf ( "设定成功!/n" );;
return 1; //设定成功!
}
int serch( int i, int j, int n)
{
for (;j<=n;j++)
{
if (G.s[i][j]==1)
break ;
}
return j;
}
int serch_error( int *k, int n) //在所有老师都有被进行安排过的情况下运行
{
int t,i,j;
static int b=0; //b检测是否有两个或两个以上的专业只有一个老师可授
for (j=1;j<=n;j++)
if (k[j]==0) //存在有科目没有老师授课
for (i=1;i<=n;i++) //哪个老师可以授此科目且此科目当前还没有老师授课
if (G.s[i][j]==1)
{
if (b!=i)
b=i;
else
return 0; //if(b!=i)b=i记录第一个没有授课的科目但有老师可以授课的老师下标
//若再次运行这个函数且另一个没有授课的科目也是这位老师可授,即有
//多个科目只有此老师可授,即调用此函数的老师没有科目可授。
t=G.D[i];
if (G.D[i]==0)
return 0; //可能有后面老师还没受到安排,返回等所有老师都有被进行安排过才进行
G.D[i]=j;
k[j]=i;
k[t]=0;
return 1; //有,让此老师授此课,原来所授的课取消,重新安排过。
}
return 0; //(没有科目没有被安排)或者(有科目没有被安排但没有老师有此专长)
}
int anpai( int *k, int n)
{
int c[MAX]={0},i,j, js, p=0,t;
for (i=1;i<=n;i++)
{
if (G.D[i]==0)
{
j=1;
while (1)
{
js=serch(i,j,n);
if (js<=n)
{
c[p++]=js; //保存从serch里返回的教师专长
if (k[js]<=0)
{
G.D[i]=js;k[js]=i;p=0; break ;
}
else
{
j=js;
j++;
}
}
else
{
p=0;
t=k[c[p]];
j=c[p]+1;
while (1)
{
js=serch(t,j,n);
if (k[js]<=0 && js<=n)
{
k[c[p]]=0; G.D[t]=js; k[js]=t; G.D[i]=c[p]; k[c[p]]=i; p=0; break ;
}
else if (js<=n)
j++;
else
{
p++;
if (c[p]==0)
{
G.D[i]=0;
if (serch_error(k,n))
anpai(k,n);
break ;
}
t=c[p];j=c[p]+1;
}
}
break ;
}
}
}
}
printf ( "教师专长课程设定成功!/n" );
return 1;
}
void display( int n)
{
int ch,i;
printf ( " 教师编号 课程编号/n" );
for (i=1;i<=n;i++)
printf ( "%5d %13d/n" ,i,G.D[i]);
}
void list( int n)
{
int i,j;
for (i=1;i<=n;i++)
{
printf ( "%3d号教师的专业特长有:" ,i);
for (j=1;j<=n;j++)
if (G.s[i][j])
printf ( "%3d/n" ,j);
printf ( "/n" );
}
}
void edit( int n)
{
int k,i=0,m=0,j=0;
printf ( "请输入要修改的老师:" );
while (i==0||i>n)
{
scanf ( "%d" ,&i);
if (i>0 && i<=n)
printf ( "第%d个老师的专长科目有: " ,i);
else
printf ( "没这个老师!请重新输入:/n" );
}
for (k=1;k<=n;k++)
{
if (G.s[i][k]==1)
{
printf ( "%3d/n" ,k);
j++;
}
}
if (j==0)
printf ( "没有专长科目/n" );
printf ( "/n输入你要修改的科目(输入0结束):/n" );
do
{
scanf ( "%d" ,&k);
if (k>n)
{
printf ( "超出范围,重新输入: " );
continue ;
}
else if (G.s[i][k]==1)
G.s[i][k]=0;
else G.s[i][k]=1;
} while (k);
printf ( "修改后第%d个老师的专长科目有 :" ,i);
for (k=1;k<=n;k++)
{
if (G.s[i][k]==1)
{
printf ( "%3d/n" ,k);
m++;
}
}
if (m==0)
printf ( "没有专长科目/n" );
printf ( "/n" );
}
int main( void )
{
int k[MAX],ch,i=0, n=0,w=0,a=0; //n为0 用来表示还没 i 检查是否专长课程设定 w 检查是否科目数设定 a检查是否课程安排
char cx;
while (1)
{
printf ( " ┏━━━━━━━━欢迎进入教学任务安排系统━━━━━━━━┓/n" );
printf ( " § §/n" );
printf ( " § 1 -----确定科目数 2 -----教师专长课程设定 §/n" );
printf ( " § 3 -----课程安排 4 -----教师专长浏览 §/n" );
printf ( " § 5 -----教师专长课程修改 6------查看教学任务安排 §/n" );
printf ( " § 0 -----退出系统 §/n" );
printf ( " └────────────────────────────┘/n" );
printf ( "请选择功能 " );
scanf ( "%d" ,&ch);
printf ( "/n" );
switch (ch)
{
case 1:
{
if (!w)
{
printf ( "请确定课程数或教师人数 " );
scanf ( "%d" ,&n);
w=creat(k, n);
break ;
} //初始化
else
{
printf ( "你已经确定了课程数 ,是否要从新确定(是:Y/y 否:其余键 )" );
scanf ( "%c" ,&cx);
if (cx== 'Y' || cx== 'y' )
{
printf ( " 重新输入课程数: " );
scanf ( "%d" ,&n);
w=creat(k, n);
break ;
}
else break ;
}
}
case 2:
{
if (!w)
printf ( "请先确定科目数!/n/n" );
else if (i)
{
printf ( "你已经教师专长课程设定 ,是否要从新设定(是:Y/y 否:其余键 )" );
scanf ( "%c" ,&cx);
if (cx== 'Y' || cx== 'y' )
{
i=techer_speciality(n);
break ;
}
else break ;
}
else
i=techer_speciality(n);
break ;
}
case 3:
{
if (!w)
printf ( "请先确定科目数!/n/n" );
else if (!i)
printf ( "请先教师专长课程设定!/n" );
else
anpai(k,n);
break ;
}
case 4:
{
if (!w)
printf ( "请先确定科目数和 教师专长课程设定!/n/n" );
else if (!i)
printf ( "请先教师专长课程设定!/n" );
else
list(n); //教师专长浏览函数
break ;
}
case 5:
{
if (!w)
printf ( "暂无确定科目数!/n" );
else if (!i)
printf ( "教师专长课程暂无设定/n" ); //教师专长课程修改函数
else
edit(n) ; //修改函数
break ;
}
case 6:
{
if (!w)
printf ( "请先确定科目数!/n/n" );
else if (!i)
printf ( "请先教师专长课程设定!/n" ); //查看教学任务安排函数
else if (!a)
printf ( "请先选择课程安排!/n" );
else ; //查看教学任务安排函数;
break ;
}
case 0:
{
printf ( " ************** 谢谢使用 ************/n" );
return ;
}
default :
printf ( "从新选择功能:/n" );
}
}
system ( "pause" );
return 0;
}
|