本文实例为大家分享了C语言实现班级学生管理系统的具体代码,供大家参考,具体内容如下
下面是根据班级,这个人数较少的单位设计的学籍管理系统,录入时,要求班内序号由1开始 按顺序录入,其中主要用到了 结构体数组,文件处理,循环语句,选择语句等方面的知识
在设计中遇到一个问题就是:不知道怎样修改已经保存在文件中的某一个指定学生的信息,后来在询问学长之后才了解到 ,可以: 先把文件中的数据全部读入结构体数组中,再修改指定序号的数组元素,然后再用“wt”的方式写进原文件,这样就可以删除文件里的原内容,再写进新内容
下面是源代码,在Dev-C++ 条件下进行编译
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
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
|
#include<stdio.h> #include<conio.h> #include<string.h> #include<stdlib.h> int count1=0; int count2=0; int count3=0; void class_print(); void men1_student(); void men2_student(); void men3_student(); void men4_student(); void input_student(); void input_grade(); void input_reward(); void input_finance(); void report_finance(); void seek_student(); void seek_grade(); void seek_reward(); void change_student(); void change_grade(); void change_reward(); int now1_student(); int now2_student(); int now3_student(); struct date { int year; int month; int day; }; struct student { char number[2]; char name[10]; char sex[4]; char tel[15]; char id[20]; char study[10]; }; struct grade { char number[2]; char name[10]; char math[4]; char English[4]; char Cprogram[4]; char sumtest[4]; }; struct reward { char number[2]; char name[10]; struct date time ; char rewarding[80]; }; struct finance { char thing[20]; char type[8]; struct date time2; int i; }; struct student m_stu[50]; struct grade g_stu[50]; struct reward r_stu[50]; struct finance f_class; struct grade t_change; main() { int choice=-1; //一级菜单 while (choice!=0) { printf ( "\n" ); printf ( "\t\t\t\t\t\t**" ); class_print(); printf ( "**\n" ); printf ( "\t\t\t\t\t\t****************************\n" ); printf ( "\t\t\t\t\t\t** 班级学生学籍管理系统 **\n" ); printf ( "\t\t\t\t\t\t** 1.户籍管理系统 **\n" ); printf ( "\t\t\t\t\t\t** 2.成绩管理系统 **\n" ); printf ( "\t\t\t\t\t\t** 3.奖惩管理系统 **\n" ); printf ( "\t\t\t\t\t\t** 4.财务管理系统 **\n" ); printf ( "\t\t\t\t\t\t** 0.退 出 **\n" ); printf ( "\t\t\t\t\t\t请选择" ); scanf ( "%d" ,&choice); switch (choice) { case 1: men1_student(); break ; case 2: men2_student(); break ; case 3: men3_student(); break ; case 4: men4_student(); break ; case 0: printf ( "返回上一级" ); break ; default : break ; } } } void men1_student() //二级菜单(学生户籍管理) { int choice=-1; while (choice!=0) { printf ( "\n" ); printf ( "\t\t\t\t\t\t****************************\n" ); printf ( "\t\t\t\t\t\t**" ); class_print(); printf ( "**\n" ); printf ( "\t\t\t\t\t\t** 班级学生户籍信息管理 **\n" ); printf ( "\t\t\t\t\t\t** 户籍信息已录入人数:" );now1_student(); printf ( " **\n" ); printf ( "\t\t\t\t\t\t** 1.户籍录入系统 **\n" ); printf ( "\t\t\t\t\t\t** 2.户籍修改系统 **\n" ); printf ( "\t\t\t\t\t\t** 3.户籍查询系统 **\n" ); printf ( "\t\t\t\t\t\t** 0.返 回 **\n" ); printf ( "\t\t\t\t\t\t请选择" ); scanf ( "%d" ,&choice); switch (choice) { case 1: input_student(); break ; case 2: change_student(); break ; case 3: seek_student(); break ; case 0: printf ( "返回上一级" ); break ; default : break ; } getch(); } } void input_student() // 户籍录入函数 录入信息保存至D盘根目录下information1.txt文件下 { int j; printf ( "学生户籍信息录入" ); printf ( "\n班内序号: " ); scanf ( "%s" ,&m_stu[count1].number); printf ( "\n姓名: " ); gets (m_stu[count1].name); gets (m_stu[count1].name); printf ( "\n性别: " ); scanf ( "%s" ,&m_stu[count1].sex); printf ( "\n电话号码: " ); scanf ( "%s" ,&m_stu[count1].tel); printf ( "\n身份证号: " ); scanf ( "%s" ,&m_stu[count1].id); printf ( "\n学号: " ); scanf ( "%s" ,&m_stu[count1].study); printf ( "是否保存该学生信息?1-保存 2-放弃" ); scanf ( "%d" ,&j); if (j==1) { FILE *info; //保存至本地文件 info= fopen ( "d:\\information1.txt" , "at+" ); fwrite (&m_stu[count1], sizeof ( struct student),1,info); fclose (info); printf ( "信息已保存至D:\\information1.tex 文件下,按任意键继续" ); count1++; } else printf ( "放弃保存,按任意键继续" ); } void seek_student() //查询户籍信息函数 { FILE *info; info= fopen ( "d:\\information1.txt" , "rt" ); int i; printf ( "请输入该学生班内序号" ); scanf ( "%d" ,&i); if (i<1||i>50) printf ( "抱歉,该学生信息不存在" ); else { rewind (info); fseek (info, sizeof ( struct student)*(i-1),0); fread (&m_stu[i-1], sizeof ( struct student),1,info); printf ( "\n\n序号 姓名 性别 电话号码\t 身份证号\t\t学号\t" ); printf ( "\n\n%d %s %s %s %s %s" ,i,m_stu[i-1].name,m_stu[i-1].sex,m_stu[i-1].tel,m_stu[i-1].id,m_stu[i-1].study); } } void change_student() //修改户籍信息 { int i=0,j,k,f; char h[100000]; FILE *info; info= fopen ( "d:\\information1.txt" , "rt" ); printf ( "\n\t请输入要修改户籍信息的学生班内序号" ); scanf ( "%d" ,&j); if (j<1||j>50) printf ( "抱歉,该学生信息不存在" ); else { rewind (info); while ( fgets (h, sizeof ( struct student),info)!=NULL) { fseek (info, sizeof ( struct student)*i,0); fread (&m_stu[i], sizeof ( struct student),1,info); i++; } } fclose (info); printf ( "\n该学生目前户籍信息为\n:" ); printf ( "\n\n序号 姓名 性别 电话号码\t 身份证号\t\t学号\t" ); printf ( "\n\n%d %s %s %s %s %s" ,j,m_stu[j-1].name,m_stu[j-1].sex,m_stu[j-1].tel,m_stu[j-1].id,m_stu[j-1].study); printf ( "确定修改此学生信息?1- 修改 2- 返回" ); scanf ( "%d" ,&k); if (k==1) { printf ( "\n姓名: " ); gets (m_stu[j-1].name); gets (m_stu[j-1].name); printf ( "\n性别: " ); scanf ( "%s" ,&m_stu[j-1].sex); printf ( "\n电话号码: " ); scanf ( "%s" ,&m_stu[j-1].tel); printf ( "\n身份证号: " ); scanf ( "%s" ,&m_stu[j-1].id); printf ( "\n学号: " ); scanf ( "%s" ,&m_stu[j-1].study); } else return ; info= fopen ( "d:\\information1.txt" , "wt" ); for (f=0;f<i;f++) { fseek (info, sizeof ( struct student)*f,0); fwrite (&m_stu[f], sizeof ( struct student),1,info); } fclose (info); printf ( "修改成功!" ); } void men2_student() //二级菜单(学生成绩管理) { int choice=-1; while (choice!=0) { printf ( "\n\t\t\t\t\t\t****************************\n" ); printf ( "\t\t\t\t\t\t**" ); class_print(); printf ( "**\n" ); printf ( "\t\t\t\t\t\t** 班级学生成绩信息管理 **\n" ); printf ( "\t\t\t\t\t\t** 成绩信息已录入人数:" );now2_student(); printf ( " **\n" ); printf ( "\t\t\t\t\t\t** 1.成绩录入系统 **\n" ); printf ( "\t\t\t\t\t\t** 2.成绩修改系统 **\n" ); printf ( "\t\t\t\t\t\t** 3.成绩查询系统 **\n" ); printf ( "\t\t\t\t\t\t** 4.综测排名系统 **\n" ); printf ( "\t\t\t\t\t\t** 0.返 回 **\n" ); printf ( "\t\t\t\t\t\t请选择" ); scanf ( "%d" ,&choice); switch (choice) { case 1:input_grade(); break ; case 2:change_grade(); break ; case 3:seek_grade(); break ; case 4: printf ( "功能正在研发中,敬请期待..." ); break ; default : break ; } getch(); } } void input_grade() // 成绩录入函数 ,录入信息保存至 D盘根目录下information2.txt文件下 { int j; printf ( "学生成绩信息录入" ); printf ( "\n班内序号" ); scanf ( "%s" ,&g_stu[count2].number); printf ( "\n姓名: " ); gets (g_stu[count2].name); gets (g_stu[count2].name); printf ( "\n高数: " ); scanf ( "%s" ,&g_stu[count2].math); printf ( "\n英语:" ); scanf ( "%s" ,&g_stu[count2].English); printf ( "\nC语言:" ); scanf ( "%s" ,&g_stu[count2].Cprogram); printf ( "\n综测:" ); scanf ( "%s" ,&g_stu[count2].sumtest); printf ( "是否保存该学生信息?1-保存 2-放弃" ); scanf ( "%d" ,&j); if (j==1) { FILE *info2; //保存至本地文件 info2= fopen ( "d:\\information2.txt" , "at+" ); fwrite (&g_stu[count2], sizeof ( struct grade),1,info2); fclose (info2); printf ( "信息已保存至D:\\information.tex2 文件下,按任意键继续" ); count2++; } else printf ( "放弃保存,按任意键继续" ); } void seek_grade() //查询成绩信息函数 { FILE *info2; info2= fopen ( "d:\\information2.txt" , "rt" ); int i; printf ( "\n\t请输入该学生班内序号" ); scanf ( "%d" ,&i); if (i<1||i>50) printf ( "\n抱歉,该学生信息不存在" ); else { rewind (info2); fseek (info2, sizeof ( struct grade)*(i-1),0); fread (&g_stu[i-1], sizeof ( struct grade),1,info2); printf ( "\n\n序号 姓名 高数 英语 C语言 综测" ); printf ( "\n\n%d %s %s %s %s %s" ,i,g_stu[i-1].name,g_stu[i-1].math,g_stu[i-1].English,g_stu[i-1].Cprogram,g_stu[i-1].sumtest); } } void change_grade() //修改成绩信息 { int i=0,j,k,f; char h[100000]; FILE *info; info= fopen ( "d:\\information2.txt" , "rt" ); printf ( "\n\t请输入要修改成绩信息的学生班内序号" ); scanf ( "%d" ,&j); if (j<1||j>50) printf ( "\n抱歉,该学生信息不存在" ); else { rewind (info); while ( fgets (h, sizeof ( struct grade),info)!=NULL) { fseek (info, sizeof ( struct grade)*i,0); fread (&g_stu[i], sizeof ( struct grade),1,info); i++; } } fclose (info); printf ( "\n该学生目前成绩信息为\n:" ); printf ( "\n\n序号 姓名 高数 英语 C语言 综测" ); printf ( "\n\n%d %s %s %s %s %s" ,j,g_stu[j-1].name,g_stu[j-1].math,g_stu[j-1].English,g_stu[j-1].Cprogram,g_stu[j-1].sumtest); printf ( "\n\t确定修改此学生信息?1- 修改 2- 返回" ); scanf ( "%d" ,&k); if (k==1) { printf ( "\n姓名: " ); gets (g_stu[j-1].name); gets (g_stu[j-1].name); printf ( "\n高数: " ); scanf ( "%s" ,&g_stu[j-1].math); printf ( "\n英语: " ); scanf ( "%s" ,&g_stu[j-1].English); printf ( "\nC语言: " ); scanf ( "%s" ,&g_stu[j-1].Cprogram); printf ( "\n综测: " ); scanf ( "%s" ,&g_stu[j-1].sumtest); } else return ; info= fopen ( "d:\\information2.txt" , "wt" ); if (info==NULL) { printf ( "不能打开此文件,按任意键继续" ); getch(); } for (f=0;f<i;f++) { fseek (info, sizeof ( struct grade)*f,0); fwrite (&g_stu[f], sizeof ( struct grade),1,info); } fclose (info); printf ( "修改成功!" ); } void men3_student() //二级菜单(学生奖惩管理) { int choice=-1; while (choice!=0) { printf ( "\n" ); printf ( "\t\t\t\t\t\t****************************\n" ); printf ( "\t\t\t\t\t\t**" ); class_print(); printf ( "**\n" ); printf ( "\t\t\t\t\t\t** 班级学生奖惩信息管理 **\n" ); printf ( "\t\t\t\t\t\t** 奖惩信息已录入人数:" );now3_student(); printf ( " **\n" ); printf ( "\t\t\t\t\t\t** 1.奖惩录入系统 **\n" ); printf ( "\t\t\t\t\t\t** 2.奖惩修改系统 **\n" ); printf ( "\t\t\t\t\t\t** 3.奖惩查询系统 **\n" ); printf ( "\t\t\t\t\t\t** 0.返 回 **\n" ); printf ( "\t\t\t\t请选择" ); scanf ( "%d" ,&choice); switch (choice) { case 1: input_reward(); break ; case 2: change_reward(); break ; case 3: seek_reward(); break ; case 0: printf ( "返回上一级" ); break ; default : break ; } getch(); } } void input_reward() // 奖惩录入函数 录入信息保存至D盘根目录下information3.txt文件下 { int j; printf ( "学生奖惩信息录入" ); printf ( "\n班内序号: " ); scanf ( "%s" ,&r_stu[count3].number); printf ( "\n姓名: " ); gets (r_stu[count3].name); gets (r_stu[count3].name); printf ( "\n奖惩时间: " ); scanf ( "%d.%d.%d" ,&r_stu[count3]. time .year,&r_stu[count3]. time .month,&r_stu[count3]. time .day); printf ( "\n具体事件: " ); gets (r_stu[count3].rewarding); gets (r_stu[count3].rewarding); printf ( "\n是否保存该学生信息?1-保存 2-放弃" ); scanf ( "%d" ,&j); if (j==1) { FILE *info; //保存至本地文件 info= fopen ( "d:\\information3.txt" , "at+" ); fwrite (&r_stu[count3], sizeof ( struct reward),1,info); fclose (info); printf ( "\n信息已保存至D:\\information3.tex 文件下,按任意键继续" ); count3++; } else printf ( "放弃保存,按任意键继续" ); } void seek_reward() //查询奖惩信息函数 根据学生班级序号 { FILE *info; info= fopen ( "d:\\information3.txt" , "rt" ); int i; printf ( "\n\t请输入该学生班内序号" ); scanf ( "%d" ,&i); if (i<1||i>50) printf ( "\n抱歉,该学生信息不存在" ); else { rewind (info); fseek (info, sizeof ( struct reward)*(i-1),0); fread (&r_stu[i-1], sizeof ( struct reward),1,info); printf ( "\n\n序号 姓名 奖惩时间 具体事件\t\t" ); printf ( "\n\n%d %s %d.%d.%d %s " ,i,r_stu[i-1].name,r_stu[i-1]. time .year, r_stu[i-1]. time .month, r_stu[i-1]. time .day, r_stu[i-1].rewarding); } } void change_reward() //修改奖惩信息 { int i=0,j,k,f; char h[100000]; FILE *info; info= fopen ( "d:\\information3.txt" , "rt" ); printf ( "\n\t请输入要修改奖惩信息的学生班内序号" ); scanf ( "%d" ,&j); if (j<1||j>50) printf ( "\n抱歉,该学生信息不存在" ); else { rewind (info); while ( fgets (h, sizeof ( struct reward),info)!=NULL) { fseek (info, sizeof ( struct reward)*i,0); fread (&r_stu[i], sizeof ( struct reward),1,info); i++; } } fclose (info); printf ( "\n该学生目前奖惩信息为\n:" ); printf ( "\n\n序号 姓名 奖惩时间 具体事件" ); printf ( "\n\n%d %s %d.%d.%d %s " ,j,r_stu[j-1].name,r_stu[j-1]. time .year, r_stu[j-1]. time .month, r_stu[j-1]. time .day ,r_stu[j-1].rewarding); printf ( "\n\t确定修改此学生信息?1- 修改 2- 返回" ); scanf ( "%d" ,&k); if (k==1) { printf ( "\n姓名: " ); gets (r_stu[j-1].name); gets (r_stu[j-1].name); printf ( "\n奖惩时间: " ); scanf ( "%d.%d.%d" ,&r_stu[j-1]. time .year,&r_stu[j-1]. time .month,&r_stu[j-1]. time .day); printf ( "\n具体事件: " ); scanf ( "%s" ,&r_stu[j-1].rewarding); } else return ; info= fopen ( "d:\\information3.txt" , "wt" ); for (f=0;f<i;f++) { fseek (info, sizeof ( struct reward)*f,0); fwrite (&r_stu[f], sizeof ( struct reward),1,info); } fclose (info); printf ( "修改成功!" ); } int now1_student() //录入户籍信息学生数目 在菜单中 显示 已经录入学生人数 { int i=1; char j[100000]; FILE *info; info= fopen ( "D:\\information1.txt" , "rt" ); rewind (info); while ( fgets (j, sizeof ( struct student),info)!=NULL) { fseek (info, sizeof ( struct student)*i,0); i++; } fclose (info); printf ( "%d" ,i-1); } int now2_student() //录入成绩信息学生数目 在菜单中 显示 已经录入学生人数 { int i=1; char j[100000]; FILE *info; info= fopen ( "D:\\information2.txt" , "rt" ); rewind (info); while ( fgets (j, sizeof ( struct grade),info)!=NULL) { fseek (info, sizeof ( struct grade)*i,0); i++; } fclose (info); printf ( "%d" ,i-1); } int now3_student() //录入奖惩信息学生数目 在菜单中 显示 已经录入学生人数 { int i=1; char j[100000]; FILE *info; info= fopen ( "D:\\information3.txt" , "rt" ); rewind (info); while ( fgets (j, sizeof ( struct reward),info)!=NULL) { fseek (info, sizeof ( struct reward)*i,0); i++; } fclose (info); printf ( "%d" ,i-1); } void class_print() // 录入专业班级信息,并保存至D盘根目录下information0.txt文件下 { char major[20],class_number[4]; FILE *info; info= fopen ( "d:\\information0.txt" , "rt" ); if (info==NULL) { info= fopen ( "d:\\information0.txt" , "wt" ); printf ( "\n请输入专业 :" ); scanf ( "%s" ,&major); printf ( "\n请输入班级 :" ); scanf ( "%s" ,&class_number); fwrite (major, sizeof (major),1,info); fwrite (class_number, sizeof (class_number),1,info); printf ( "\n\t已保存专业班级信息!" ); fclose (info); info= fopen ( "d:\\information0.txt" , "rt" ); fread (&major, sizeof (major),1,info); fread (&class_number, sizeof (class_number),1,info); printf ( "%s" ,major); printf ( "%s班" ,class_number); } else { fread (&major, sizeof (major),1,info); fread (&class_number, sizeof (class_number),1,info); printf ( "%s" ,major); printf ( "%s班" ,class_number); fclose (info); } } void men4_student() //二级菜单(班级财务管理) { int choice=-1; while (choice!=0) { printf ( "\n" ); printf ( "\t\t\t\t\t\t****************************\n" ); printf ( "\t\t\t\t\t********财务信息不可修改,请谨慎录入!******\n" ); printf ( "\t\t\t\t\t\t** 班级学生财务信息管理 **\n" ); printf ( "\t\t\t\t\t\t** 1.财务录入系统 **\n" ); printf ( "\t\t\t\t\t\t** 2.财务报表系统 **\n" ); printf ( "\t\t\t\t\t\t** 0.返 回 **\n" ); printf ( "\t\t\t\t\t\t请选择" ); scanf ( "%d" ,&choice); switch (choice) { case 1: input_finance(); break ; case 2: report_finance(); break ; case 3: case 0: printf ( "返回上一级" ); break ; default : break ; } getch(); } } void input_finance() // 财务录入函数 ,录入后信息保存到D盘根目录下 information4.txt文件中 { int j; printf ( "班级财务信息录入" ); printf ( "\n收支时间: " ); scanf ( "%d.%d.%d" ,&f_class.time2.year,&f_class.time2.month,&f_class.time2.day ); printf ( "\n具体事件: " ); gets (f_class.thing); gets (f_class.thing); printf ( "\n财务类型(收入或开支): " ); scanf ( "%s" ,&f_class.type); printf ( "\n流动金额(收入为正开支为负): " ); scanf ( "%d" ,&f_class.i); printf ( "\n是否保存该财务信息?1-保存 2-放弃" ); scanf ( "%d" ,&j); if (j==1) { FILE *info; //保存至本地文件 info= fopen ( "d:\\information4.txt" , "at+" ); fwrite (&f_class, sizeof ( struct finance),1,info); fclose (info); printf ( "\n信息已保存至D:\\information4.txt 文件下,按任意键继续" ); } else printf ( "放弃保存,按任意键继续" ); } void report_finance() // 财务信息报表 { char h[100000]; int sum=0,i=0; printf ( "\n收支时间 具体事件\t财务类型 流动金额\n" ); FILE *info; info= fopen ( "d:\\information4.txt" , "rt" ); while ( fgets (h, sizeof ( struct finance),info)!=NULL) { fseek (info, sizeof ( struct finance)*i,0); fread (&f_class, sizeof ( struct finance),1,info);i++; printf ( "\n%d.%d.%d %s %s %d\n" ,f_class.time2.year, f_class.time2.month, f_class.time2.day, f_class.thing,f_class.type,f_class.i); sum=sum+f_class.i ; } printf ( "\n\t\t班费余额:%d元" ,sum); } |
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持服务器之家。
原文链接:https://blog.csdn.net/wintershii/article/details/78946171