程序代写代做代考 C µÚ¾ÅÕ ×ÛºÏʵѵ

µÚ¾ÅÕ ×ÛºÏʵѵ
ʵÑé 12 ѧÉú³É¼¨¹ÜÀíϵͳ(V4.0 °æ)
Ò»¡¢ÊµÑéÄ¿µÄ
1¡¢ÕÆÎÕ C ÓïÑÔµÄÖ÷Ҫ֪ʶµã:±äÁ¿¡¢¿ØÖÆÓï¾ä¡¢Êý×é¡¢º¯Êý¡¢Ö¸Õë¡¢½á¹¹Ìå¡¢ÎļþµÈ; 2¡¢ÕÆÎÕ C ³ÌÐòµÄ½á¹¹»¯³ÌÐòÉè¼Æ·½·¨£¬ÄÜʹÓà C ÓïÑÔ¿ª·¢¼òµ¥µÄÓ¦ÓóÌÐò; 3¡¢ÕÆÎÕ¶àÎļþ³ÌÐòµÄÔËÐС¢µ÷ÊԵȡ£
¶þ¡¢ÊµÑéÄÚÈݺͲ½Öè
Éè¼ÆÒ»¸öѧÉú³É¼¨¹ÜÀíϵͳ£¬²¢¸ø³ö³ÌÐòÔ´´úÂë¡£
Èý¡¢ÊµÑµÒªÇó
(1)Äܽ¨Á¢ÐÂÊý¾ÝÎļþ£¬´æ·ÅѧÉúµµ°¸ÐÅÏ¢¼°¿¼ÊԳɼ¨;
(2)ÄÜ×·¼ÓмǼ;
(3)ÄÜÐÞ¸ÄÒÑÓмǼ;
(4)ÄÜɾ³ýÖ¸¶¨¼Ç¼;
(5)Äܲéѯ²¿·Ö¼Ç¼;
(6)ÄÜÅÅÐò¼Ç¼;
(7)ÄÜÓò˵¥·½·¨²Ù×÷¡£
ËÄ¡¢ÏµÍ³Éè¼Æ
1¡¢Êý¾ÝÎļþÉè¼Æ
²ÉÓÃÎı¾Îļþ´æ·ÅÊý¾Ý£¬Êý¾Ý½á¹¹ÈçϱíËùʾ¡£
ѧÉú³É¼¨¹ÜÀíϵͳµÄÊý¾Ý½á¹¹
×Ö¶ÎÃû
ÀàÐÍ
ÃèÊö
sno
char[8]
´æ·ÅѧºÅ£¬±ØÐëΨһ
sname
char[8]
´æ·ÅÐÕÃû
math
int
´æ·ÅÊýѧ³É¼¨
computer
int
´æ·Å¼ÆËã»ú³É¼¨
english
int
´æ·ÅÓ¢Óï³É¼¨
average
float
´æ·Åƽ¾ù³É¼¨
2¡¢¹¦ÄÜÉè¼Æ
ѧÉú³É¼¨¹ÜÀíϵͳµÄ¹¦ÄÜÈçÏÂͼËùʾ¡£

ѧÉú³É¼¨¹ÜÀíϵͳ
Ð޸ļǼ
²éѯ¼Ç¼
ɾ³ý¼Ç¼
ÅÅÐò¼Ç¼
°´ ¼Ç ¼ ºÅ ÐÞ ¸Ä
°´ ѧ ºÅ ÐÞ ¸Ä
°´ ÐÕ Ãû ÐÞ ¸Ä
°´ ¼Ç ¼ ºÅ ɾ ³ý
°´ ѧ ºÅ ɾ ³ý
°´ ÐÕ Ãû ɾ ³ý
°´ ¼Ç ¼ ºÅ ÐÞ ¸Ä
°´ ѧ ºÅ ²é ѯ
°´ ÐÕ Ãû ²é ѯ
²é ѯ È« ²¿ ¼Ç ¼
×·¼Ó¼Ç¼
3¡¢Ä£¿éÉè¼Æ
ºÅ
ÐÞ
¸Ä
¸ù¾Ý¹¦ÄÜÐèÇ󣬱¾ÏµÍ³·Ö 6 ´óÄ£¿éºÍ 1 ¸öÍ·Îļþ£¬ÈçϱíËùʾ¡£ ѧÉú³É¼¨¹ÜÀíϵͳµÄÄ£¿é
ÐòºÅ
º¯ÊýÃû(¹¦ÄÜÄ£¿é)
¹¦ÄÜ
1
main()
Ö÷¿Øº¯Êý
2
menu_select( )
²Ëµ¥Ñ¡Ôñ
3
update_mune( );
Ð޸ļǼ×Ӳ˵¥
4
delete_mune( );
ɾ³ý¼Ç¼×Ӳ˵¥
5
query_mune( );
²éѯ¼Ç¼×Ӳ˵¥
6
s_read( )
¶ÁÈ¡¼Ç¼
7
s_save( )
±£´æ¼Ç¼
8
sno_exist( )
ÅжÏijѧºÅÊÇ·ñ´æÔÚ
9
s_insert( )
Ìí¼Ó¼Ç¼
10
s_sort( )
ÅÅÐò¼Ç¼
11
update_rec( )
°´¼Ç¼ºÅÐ޸ļǼ
12
update_sno( )
°´Ñ§ºÅÐ޸ļǼ
13
update_sname( )
°´ÐÕÃûÐ޸ļǼ
14
delete_rec( )
°´¼Ç¼ºÅɾ³ý¼Ç¼

15
delete_sno( )
°´Ñ§ºÅɾ³ý¼Ç¼
16
delete_sname( )
°´ÐÕÃûɾ³ý¼Ç¼
17
query_rec( )
°´¼Ç¼ºÅ²éѯ¼Ç¼
18
query_sno( )
°´Ñ§ºÅ²éѯ¼Ç¼
19
query_sname( )
°´ÐÕÃû²éѯ¼Ç¼
20
s_disp( )
²éѯËùÓмǼ
4¡¢×ÜÌåÉè¼Æ˼Ïë
ΪÁ˼ò»¯³ÌÐò£¬²ÉÓÃËùÓмǼ²Ù×÷ͨ¹ýÊý×é»òÖ¸ÕëÍê³É£¬µ±³ÌÐò¿ªÊ¼Ö´ÐÐʱ°ÑÊý¾ÝÎļþ Ò»´ÎÐÔ¶ÁÈëµ½½á¹¹ÌåÊý×飬ÒÔºó¶ÔÊý¾ÝµÄ²Ù×÷¶¼Í¨¹ý½á¹¹ÌåÊý×éÀ´Íê³É¡£Ö»Óе±Êý¾Ý·¢Éú±ä »¯Ê±²Å½øÐÐдÎļþ²Ù×÷¡£
¾ßÌåʵÏÖʱ,½¨Òé²ÉÓÃÈçÏÂÄ£¿é½á¹¹:
(1)Í·Îļþ student_head.h¡£ÓÉÓÚ¶à¸öÎļþÐèÒª½øÐнṹÉùÃ÷¡¢Íⲿ±äÁ¿ÉùÃ÷£¬Òò´ËΪÁË ¼õÉÙ´úÂ룬²ÉÓÃÍ·ÎļþÐÎʽ¡£Í·ÎļþÖж¨Òå½á¹¹Ìå¼°È«¾Ö±äÁ¿¡£
(2)Ö÷¿ØÎļþ student_main.c¡£¸ºÔð¿âº¯Êý¼°º¯ÊýÔ­ÐÍÉùÃ÷£¬È«¾Ö±äÁ¿ÉùÃ÷;¸ºÔð²Ëµ¥Ñ¡ ÔñºÍ²Ëµ¥´¦Àí¡£
Ö´ÐÐÁ÷³ÌÈçÏÂ:
1º¯Êý¡¢º¯ÊýÔ­ÐÍÉùÃ÷£¬È«¾Ö±äÁ¿ÉùÃ÷¡£
2Ö÷º¯ÊýµÄ¹¦ÄÜ:µ÷Óà s_read( )º¯Êý£¬´ÓÎļþÊǶÁÈ¡¼Ç¼µ½½á¹¹ÌåÊý×éÖÐ;µ÷Óò˵¥´¦Àí º¯ÊýÀ´¶Ô²Ëµ¥½øÐд¦Àí£¬µ±Ñ¡Ôñijһ²Ëµ¥ºóÏÔʾÏàÓ¦µÄ×Ӳ˵¥»òÖ±½Óµ÷ÓÃij¸ö¹¦ÄÜÄ£¿é¡£ (3)¹«ÓÃÎļþ student_pub.c¡£Ëü°üÀ¨Èý¸öº¯Êý:¶ÁÈ¡¼Ç¼º¯Êý s_read( )¡¢±£´æ¼Ç¼º¯ Êý s_save( )ºÍÅжÏѧºÅÊÇ·ñ´æÔڵĺ¯Êý s_exist()¡£ÕâЩº¯ÊýµÄ¹¦ÄÜÊÇ:
1s_read( ) º¯Êý:µ±µÚÒ»´ÎʹÓñ¾ÏµÍ³Ê±£¬Ó¦ÒѾ­½¨Á¢Êý¾ÝÎļþ st_table.txt£¬ÒÔºóÔò ÄÜ´Ó¸ÃÎļþÖжÁÈ¡¼Ç¼²¢´æÈëµ½½á¹¹ÌåÊý×éÖС£
2s_save( ) º¯Êý:µ±Ôö¼Ó¡¢É¾³ý»òÐÞ¸ÄÁËÊý¾Ý¼Ç¼£¬Í¨¹ý¸Ãº¯Êý°Ñ×îÖÕÊý¾ÝÖØÐÂд»Øµ½´Å ÅÌÎļþ st_table.txt ÖС£ 3sno_exist()º¯Êý:ÓÃÀ´ÅжÏѧºÅÊÇ·ñ´æÔÚ£¬Èô´æÔÚÔò·µ»Øº¯ÊýÖµ 1£¬·ñÔò·µ»Ø 0¡£ÒòΪ ±¾ÏµÍ³ÒªÇóѧºÅ×÷ΪΩһµÄ¹Ø¼ü×Ö£¬¼´²»ÔÊÐí³öÏÖÖظ´µÄѧºÅ£¬µ±Ö´ÐÐÌí¼Ó¡¢Ð޸IJÙ×÷ʱ£¬ ͨ¹ýµ÷Óñ¾º¯Êý±£Ö¤Ñ§ºÅµÄΨһÐÔ¡£
(4)×·¼Ó¡¢ÅÅÐò¼Ç¼Îļþ(student_ins.c)
´ËÎļþ°üº¬Á½¸öº¯Êý£¬Ìí¼Ó¼Ç¼º¯Êý s_insert( ) ºÍ°´×Ü·ÖÅÅÐòºóÊä³öº¯Êý s_sort( )¡£¸÷ º¯ÊýµÄ¹¦ÄÜÈçÏÂ:
1s_insert() º¯Êý:ÓÃÀ´ÊµÏÖÏò½á¹¹ÌåÊý×éÖÐÌí¼ÓÒ»ÌõмǼ£¬ÔÚÊäÈëʱ¶ÔѧºÅµÄÖظ´½ø ÐÐÅжϡ£
2s_sort( ) º¯Êý:ÓÃÀ´ÊµÏÖ°´×Ü·ÖÅÅÐò£¬±¾ÏµÍ³²ÉÓÃÆðÅÝÅÅÐò·¨£¬Í¬Ñ§ÃÇÒ²¿ÉÒÔʹÓÃÆäËû ÅÅÐò·¨¡£
(5)Ð޸ļǼÎļþ(student_updat.c)
´ËÎļþ°üÀ¨Èý¸öº¯Êý¡£°´¼Ç¼ºÅÐ޸ĺ¯Êý update_rec()¡¢°´Ñ§ºÅÐ޸ĺ¯Êý update_sno()¡¢ °´ÐÕÃûÐ޸ĺ¯Êý update_sname()£¬¸÷º¯Êý¹¦ÄÜÈçÏÂ: 1update_rec()º¯Êý:ÓÃÀ´ÊµÏÖ°´¼Ç¼ºÅµÄÐ޸ģ¬Ê×ÏÈÊäÈëÒªÐ޸ĵļǼºÅ£¬Èô´æÔÚÔòÏÔʾ Ô­Êý¾Ý£¬È»ºóÌáʾÊäÈëÐÂÊý¾Ý£¬ÊäÈëʱ¶ÔѧºÅµÄÖظ´½øÐÐÅжϣ¬ÈôÒÑ´æÔÚѧºÅÔò²»ÔÊÐíÊäÈë; ·ñÔòÌáʾ¼Ç¼ºÅ²»´æÔÚ¡£ 2update_sno()º¯Êý:ÓÃÀ´ÊµÏÖ°´Ñ§ºÅµÄÐ޸ģ¬Ê×ÏÈÊäÈëÒªÐ޸ĵÄѧºÅ£¬Èô´æÔÚÔòÏÔʾԭÊý ¾Ý£¬È»ºóÌáʾÊäÈëÐÂÊý¾Ý£¬ÊäÈëʱ¶ÔѧºÅµÄÖظ´½øÐÐÅжϣ¬ÈôÒÑ´æÔÚѧºÅÔò²»ÔÊÐíÊäÈë;·ñ

ÔòÌáʾѧºÅ²»´æÔÚ¡£
3update_sname()º¯Êý:ÓÃÀ´ÊµÏÖ°´ÐÕÃûÐÞ¸Ä
(6)ɾ³ý¼Ç¼Îļþ(student_del.c)
´ËÎļþ°üÀ¨Èý¸öº¯Êý¡£°´¼Ç¼ºÅɾ³ýº¯Êý delete_rec()¡¢°´Ñ§ºÅɾ³ýº¯Êý delete_sno()¡¢ °´ÐÕÃûɾ³ýº¯Êý delete_sname()£¬¸÷º¯Êý¹¦ÄÜÈçÏÂ: 1delete_rec()º¯Êý:ÓÃÀ´ÊµÏÖ°´¼Ç¼ºÅɾ³ý¼Ç¼£¬Ê×ÏÈÊäÈëҪɾ³ýµÄ¼Ç¼ºÅ£¬Èô´æÔÚÔòÏÔ Ê¾Ô­Êý¾Ý£¬È»ºóÌáʾÊÇ·ñÕæµÄҪɾ³ý£¬ÈôÊäÈë¡°Y¡±Ôò½øÐÐɾ³ý²Ù×÷£¬É¾³ýͨ¹ý¼Ç¼ÉÏÒÆµÄ ·½·¨ÊµÏÖ;·ñÔòÌáʾ¼Ç¼ºÅ²»´æÔÚ¡£ 2delete_sno()º¯Êý:ÓÃÀ´ÊµÏÖ°´Ñ§ºÅɾ³ý¼Ç¼£¬Ê×ÏÈÊäÈëҪɾ³ýµÄѧºÅ£¬Èô´æÔÚÔòÏÔʾԭ Êý¾Ý£¬È»ºóÌáʾÊÇ·ñÕæµÄҪɾ³ý£¬ÈôÊäÈë¡°Y¡±Ôò½øÐÐɾ³ý²Ù×÷£¬É¾³ýͨ¹ý¼Ç¼ÉÏÒƵķ½·¨ ʵÏÖ;·ñÔòÌáʾѧºÅ²»´æÔÚ¡£ 3delete_sname()º¯Êý:ÓÃÀ´ÊµÏÖ°´ÐÕÃûɾ³ý¼Ç¼£¬Ê×ÏÈÊäÈëҪɾ³ýµÄÐÕÃû£¬Èô´æÔÚÔòÏÔʾ Ô­Êý¾Ý£¬È»ºóÌáʾÊÇ·ñÕæµÄҪɾ³ý£¬ÈôÊäÈë¡°Y¡±Ôò½øÐÐɾ³ý²Ù×÷£¬É¾³ýͨ¹ý¼Ç¼ÉÏÒƵķ½ ·¨ÊµÏÖ£¬²¢¿Éɾ³ý¶à¸öÏàͬÐÕÃûµÄ¼Ç¼;·ñÔòÌáʾÐÕÃû²»´æÔÚ¡£ (7)²éѯ¼Ç¼Îļþ(student_query.c)
´ËÎļþ°üÀ¨Ëĸöº¯Êý¡£°´¼Ç¼ºÅ²éѯº¯Êý query _rec()¡¢°´Ñ§ºÅ²éѯº¯Êý query _sno()¡¢ °´ÐÕÃû²éѯº¯Êý query_sname()ºÍ²éѯȫ²¿¼Ç¼º¯Êý s_disp(),¸÷º¯Êý¹¦ÄÜÈçÏÂ: 1query_rec()º¯Êý:ÓÃÀ´ÊµÏÖ°´¼Ç¼ºÅ²éѯ¼Ç¼£¬Ê×ÏÈÊäÈëÒª²éѯµÄ¼Ç¼ºÅ£¬Èô´æÔÚÔòÏÔ Ê¾Ô­Êý¾Ý;·ñÔòÌáʾ¼Ç¼ºÅ²»´æÔÚ¡£ 2query_sno()º¯Êý:ÓÃÀ´ÊµÏÖ°´Ñ§ºÅ²éѯ¼Ç¼£¬Ê×ÏÈÊäÈëÒª²éѯµÄѧºÅ£¬Èô´æÔÚÔòÏÔʾԭ Êý¾Ý;·ñÔòÌáʾѧºÅ²»´æÔÚ¡£ 3query_sname()º¯Êý:ÓÃÀ´ÊµÏÖ°´ÐÕÃû²éѯ¼Ç¼£¬Ê×ÏÈÊäÈëÒª²éѯµÄÐÕÃû£¬Èô´æÔÚÔòÏÔʾ Ô­Êý¾Ý;·ñÔòÌáʾÐÕÃû²»´æÔÚ¡£
4s_disp()º¯Êý:¸Ãº¯Êý½«Êý¾Ý¼Ç¼°´Ë³ÐòÊä³ö¡£
(8)ÏîÄ¿Îļþ(³É¼¨¹ÜÀíϵͳ.prj) ÒòΪ±¾ÏµÍ³²ÉÓöà¸öÎļþÀ´Íê³ÉËùÓй¦ÄÜ£¬Éæ¼°µ½¶àÎļþµÄ³ÌÐòÔËÐУ¬²Ù×÷·½·¨¿É²Î¿¼½Ì²Ä ÄÚÈÝ¡£¾ßÌå¹ý³ÌÊÇ:ÏȽ¨Á¢ÏîÄ¿Îļþ£¬È»ºó½«ÏÂÁÐÎļþÌí¼Óµ½ÏîÄ¿ÖÐ:
student_main.c
student_ins.c
student_updat.c
student_del.c
student_query.c
student_pub.c
×îºó±àÒë¡¢Á¬½ÓºÍÖ´ÐÐ student_main ³ÌÐò¡£
5¡¢ÊµÑµ¾ßÌåÒªÇó
1Ò»°ãÒªÇó
Ê×ÏÈÔĶÁÔ´´úÂ룬Á˽â³ÌÐòÉè¼ÆµÄ×ÜÌåÒªÇó;
¼ÈëËù¸ø³öµÄÔ´´úÂ룬±àÒë¡¢Á¬½Ó£¬ÔËÐгÌÐò;È»ºó²¹³ä¿ÕȱµÄº¯Êý(¹² 7 ´¦)£¬Ê¹Ïµ ͳÍêÕû¡£
2½øÒ»²½ÍêÉƱ¾ÏµÍ³
a) ʵÏÖϵͳÓÃÃÜÂëµÇ¼£¬ÃÜÂë±£´æÔÚÒ»¸ö¶þ½øÖÆÎļþÖУ¬½«´Ó¼üÅÌÊäÈëµÄÃÜÂëºÍ´ÓÎļþ¶Á
ÈëµÄÃÜÂëÏà±È½Ï£¬¶þÕßÏàµÈµÄ»°¿ÉÒÔ½øÈ뱾ϵͳ¡£
b) È罫ȫÌåѧÉúÐÅϢʵÏÖ±í¸ñʽµÄÏÔʾ¡¢·ÖÒ³ÏÔʾ;
c) ÅÅÐò¿ÉÒÔÑ¡ÔñÅÅÐòÏîÄ¿(Èçijһ³É¼¨)£¬¿ÉÑ¡ÔñÉýÐò¿É½µÐò;

d) ¸Äд°´¼Ç¼ºÅ²éѯµÈº¯Êý¡£ÒªÇó¼Ç¼ºÅÓɲÎÊý´«½øÀ´£¬¶ø²»ÊÇÔÚÆäÖмÈ룬ÔÚº¯ÊýÄÚ²¿ ÅжϺϷ¨ÐÔ£¬Èç¹ûºÏ·¨·µ»Ø 1£¬Ê§°Ü·µ»Ø 0£¬º¯ÊýÐÎʽΪ int query(int recno,struct strudent *p)µÈ¡£
ʵѵ½á¹ûµÄÌá½»:ÿ¸öѧÉúÓ¦Ìá½»Ò»¸öÎļþ¼Ð£¬ÆäÖаüÀ¨Ò»¸ö¿ÉÖ´ÐÐÎļþ¡¢È«²¿Ô´³ÌÐòºÍѧ ÉúÐÅÏ¢Îļþ¡£
Îå¡¢Ô´´úÂë²Î¿¼
/ * * * * ** * * ** * * ** * * ** * ** ** * * * * **
Îļþ student_head.h µÄ´úÂë:
* * * * * * * * * * * * * * * * * ** * * * * * * * * * * * */
struct student_cj{ char sno[8];
char sname[8]; int math;
int computer; int english; float average;
};
/ * * * * ** * * ** * * ** * * ** * ** ** * * * * **
Îļþ student_main.c µÄ´úÂë:
* * * * * * * * * * * * * * * * * ** * * * * * * * * * * * */
# include
# include
# include
#include “student_head.h”
# define LEN sizeof(struct student_cj)
int reccount=0; /* ¶¨ÒåÈ«¾Ö±äÁ¿´æ·Åµ±Ç°¼Ç¼Êý */

void s_read(struct student_cj stud[ ] ); void s_disp( struct student_cj stud[ ]);
/*º¯ÊýÉùÃ÷:¶Á¼Ç¼*/ /*º¯ÊýÉùÃ÷:ÏÔʾËùÓмǼ*/
/*º¯ÊýÉùÃ÷:±£´æ¼Ç¼*/ /*º¯ÊýÉùÃ÷:ÅжÏѧºÅÊÇ·ñ´æÔÚ*/
/*º¯ÊýÉùÃ÷:×·¼Ó¼Ç¼*/ /*º¯ÊýÉùÃ÷:°´¼Ç¼ºÅ²éѯ¼Ç¼*/
/*º¯ÊýÉùÃ÷:°´Ñ§ºÅ²éѯ¼Ç¼*/ /*º¯ÊýÉùÃ÷:°´ÐÕÃû²éѯ¼Ç¼*/
/*º¯ÊýÉùÃ÷:°´¼Ç¼ºÅÐ޸ļǼ*/ /*º¯ÊýÉùÃ÷:°´Ñ§ºÅÐ޸ļǼ*/ /*º¯ÊýÉùÃ÷:°´ÐÕÃûÐ޸ļǼ*/
/*º¯ÊýÉùÃ÷:°´¼Ç¼ºÅɾ³ý¼Ç¼*/ /*º¯ÊýÉùÃ÷:°´Ñ§ºÅɾ³ý¼Ç¼*/ /*º¯ÊýÉùÃ÷:°´ÐÕÃûɾ³ý¼Ç¼*/
/*º¯ÊýÉùÃ÷:°´×Ü·ÖÅÅÐò*/
void s_save(struct
int sno_exist(struct
void s_insert(struct
void query_rec( struct student_cj stud[]);
void query_sno( struct student_cj stud[]);
void query_sname( struct student_cj stud[]); void update_rec(struct student_cj stud[ ] ) ; void update_sno( struct student_cj stud[ ]) ; void update_sname( struct student_cj stud[ ]) ; void delete_rec( struct student_cj stud[ ] ) ; void delete_sno( struct student_cj stud[ ] ) ; void delete_sname( struct student_cj stud[ ] ) ; void s_sort(struct student_cj stud[ ] ) ;
student_cj student_cj student_cj
);
stud[ ]
stud[ ], char num[ ] ); stud[ ] ) ;

int menu_select( ) ; void update_mune(struct void delete_mune(struct void query_mune(struct
/*main()º¯Êý*/ int main( )
student_cj student_cj student_cj
stud[ ]); stud[ ]); stud[ ]);
/*º¯ÊýÉùÃ÷:²Ëµ¥Ñ¡Ôñ*/ /*Ð޸ļǼ×Ӳ˵¥*/
/*ɾ³ý¼Ç¼×Ӳ˵¥*/ /*²éѯ¼Ç¼×Ӳ˵¥*/
/* ¶¨Òå½á¹¹Ìå */ /*µ÷ÓöÁ¼Ç¼º¯Êý*/
{
int k;
struct student_cj stud[40];
s_read(stud); system(“cls”); /*ÇåÆÁ*/ while(1)
{
k=menu_select(); switch(k)
{
case 1: s_insert(stud);
s_disp(stud);
break; case 2:
update_mune(stud);
break; case 3:
delete_mune(stud);
break; case 4:
query_mune(stud);
break;
case 5:s_sort(stud);break;
case 0: printf(“½áÊøϵͳ£¬ÔÙ¼û!\n”);
s_save(stud);
return 0; }
} }
/* ¶¨ÒåÑ¡Ôñ²Ëµ¥º¯Êý*/ int menu_select()
{
int cn; /*ÒÔÏÂÏÔʾÖ÷²Ëµ¥*/

printf(“\n\n printf(” printf(“\n printf(“\n printf(“\n printf(“\n printf(“\n printf(“\n printf(” while(1)
[ Ö÷²Ëµ¥ ]\n\n”); +—————– -+\n”);
| | | | | |
+ – – – – –
1. ×·¼Ó¼Ç¼ 2. Ð޸ļǼ 3. ɾ³ý¼Ç¼ 4. ²éѯ¼Ç¼ 5. ÅÅÐò¼Ç¼ 0. Í˳ö
– – – – – – – – – – – –
|\n”); |\n”); |\n”); |\n”); |\n”); |\n”);
+ \n”);
{
printf(“\n ÇëÑ¡Ôñ(0-5):”); scanf(“%d”,&cn);
printf(“\n”);
if(cn<0||cn>5) printf(“\n ÊäÈë´íÎó!”);
else break; }
return cn; }
/*Ð޸ļǼ×Ӳ˵¥*/ void update_mune(struct { int flag=1,select;
while(flag) {
student_cj
stud[ ])
printf(“\n
printf(”
printf(“\n
printf(“\n
printf(“\n
printf(“\n
printf(”
printf(” scanf(“%d”,&select); switch(select)
[ Ð޸ļǼ×Ӳ˵¥ ]\n\n”);
+—— ———– —+\n”);
| 1. °´¼Ç¼ºÅÐÞ¸Ä | 2. °´Ñ§ºÅÐÞ¸Ä
| 3. °´ÐÕÃûÐÞ¸Ä
| 0. ·µ»Ø
– – – – – – –
|\n”); |\n”); |\n”); |\n”);
– – -+ \n”);
+ – – – – – – – – – – ÇëÑ¡Ôñ(0-3):”);
{
case 0:flag=0;return ;
case 1: update_rec(stud);break; case 2: update_sno(stud) ;break; case 3: update_sname(stud);break;
}
s_disp(stud); }

}
/ * * * * ** * * ** * * ** * * ** * ** ** * * * * **
Îļþ student_pub.c µÄ´úÂë:
* * * * * * * * * * * * * * * * * ** * * * * * * * * * * * */
# include
# include
# include
#include “student_head.h”
# define LEN sizeof(struct
extern reccount;
/* ´ÓÎļþ¶Á¼Ç¼º¯Êý*/
void {
s_read(struct student_cj stud[ ])
FILE *fp;
if((fp=fopen(“st_table.txt”, “r”)) == NULL) {
printf(“²»ÄÜ´ò¿ªÎļþ!\n”); exit(1);
}
reccount=0; while(!feof(fp))

student_cj)
{
fscanf(fp,”%s%s%d%d%d”,
stud[reccount].sno,stud[reccount].sname,&stud[reccount].math ,
&stud[reccount].computer,&stud[reccount].english ); stud[reccount].average =(stud[reccount].math
+stud[reccount].computer+stud[reccount].english)/3.0; reccount++;
}
fclose(fp);
printf(“¼Ç¼×ÜÊý=%d \n”,reccount );
}
/* д¼Ç¼µ½Îļþº¯Êý*/
void s_save(struct student_cj stud[ ]) {
FILE *fp;
int i;
if((fp=fopen(“st_table.txt”, “w”)) == NULL)

}
{
printf(“²»ÄÜ´ò¿ªÎļþ!\n”);
exit(1); }
for(i=0; i<=reccount-2; i++) fprintf(fp,"%s%10s%5d%5d%5d\n", stud[i].sno,stud[i].sname,stud[i].math,stud[i].english,stud[i].computer); //×îºóÒ»Ìõ¼Ç¼µÄ»Ø³µ²»ÄÜдµ½ÎļþÖÐÈ¥ fprintf(fp,"%s%10s%5d%5d%5d", stud[i].sno,stud[i].sname,stud[i].math,stud[i].english,stud[i].computer); fclose(fp); /* ÅжÏѧºÅÊÇ·ñ´æÔÚº¯Êý*/ int sno_exist(struct student_cj stud[ ], char num[ ]) { int i; int flag=0; for(i=0; i
/* °´¼Ç¼ºÅɾ³ýº¯Êý*/
void delete_rec(struct student_cj stud[ ]) {
student_cj)

} {
} }
for(i=rec-1; ireccount)
{
printf(“ÊäÈë´íÎó!\n”);
return; }
scanf(“%c”, &yn);
printf(“\n µ±Ç°¼Ç¼ÐÅϢΪ:\n”); printf(“ѧºÅ:%s\n”, stud[rec-1].sno); printf(“ÐÕÃû:%s\n”, stud[rec-1].sname); printf(“Êýѧ:%d\n”, stud[rec-1].math); printf(“¼ÆËã»ú:%d\n”, stud[rec-1].computer); printf(“Ó¢Óï:%d\n”, stud[rec-1].english); while(1)
{
printf(“ÕæµÄɾ³ýµ±Ç°¼Ç¼Âð?(Y/N):”); scanf(“%c”, &yn);
if(yn==’y’ || yn==’Y’ || yn==’n’ || yn==’N’)
break; else
printf(“ÊäÈë´íÎó!”); if(yn == ‘Y’ || yn == ‘y’)
/* °´Ñ§ºÅɾ³ý¼Ç¼µÄº¯Êýº¯ÊýÃû: delete_sno() */ void delete_sno(struct student_cj stud[ ])
{
/******************begin*******************/

/*******************end********************/ }
/* °´ÐÕÃûɾ³ý¼Ç¼µÄº¯Êýº¯ÊýÃû: delete_sname()*/
void delete_sname(struct student_cj stud[ ]) {
/******************begin*******************/
/*******************end********************/ }
/ * * * * ** * * ** * * ** * * ** * ** ** * * * * **
Îļþ student_ins.c µÄ´úÂë:
* * * * * * * * * * * * * * * * * ** * * * * * * * * * * * */
student_cj)
# include
# include
# include
#include “student_head.h”

# define LEN sizeof(struct extern reccount;
int sno_exist(struct student_cj stud[ ], char num[ ] ); /*º¯ÊýÉùÃ÷:ÅжÏѧºÅÊÇ·ñ´æÔÚ*/
/* ×·¼Ó¼Ç¼º¯Êý*/
void s_insert(struct student_cj stud[ ]) {
printf(“ѧºÅ:”);
scanf(“%s”, stud[reccount].sno); if(sno_exist(stud, stud[reccount].sno) == 1) { printf(“ѧºÅÒÑ´æÔÚ!\n”);
return; }

}
printf(“ÐÕÃû:”);
scanf(“%s”, stud[reccount].sname); printf(“Êýѧ:”);
scanf(“%d”, &stud[reccount].math); printf(“¼ÆËã»ú:”);
scanf(“%d”, &stud[reccount].computer); printf(“Ó¢Óï:”);
scanf(“%d”, &stud[reccount].english); stud[reccount].average=
(stud[reccount].math+stud[reccount].computer+stud[reccount].english)/3.0; reccount++;
printf(“µ±Ç°¼Ç¼×ÜÊý=%d\n”, reccount );
/* °´×Ü·ÖÅÅÐò¼Ç¼º¯Êý£¬º¯ÊýÃû: s_sort ( )*/ void s_sort(struct student_cj stud[ ])
{
/******************begin*******************/
/*******************end********************/ }
/ * * * * ** * * ** * * ** * * ** * ** ** * * * * **
Îļþ student_query.c µÄ´úÂë:
* * * * * * * * * * * * * * * * * ** * * * * * * * * * * * */
# include
# include
# include
#include “student_head.h”
# define LEN sizeof(struct
extern reccount;

/* °´¼Ç¼ºÅ²éѯº¯Êý*/
void query_rec(struct student_cj stud[ ]) {
int rec;
student_cj)

struct student_cj *p;
p=stud; printf(“ÇëÊäÈëÒª²éѯµÄ¼Ç¼ºÅ:”); scanf(“%d”, &rec);
if(rec< 1 || rec>reccount) {
printf(“ÊäÈë´íÎó!\n”);
return; }
printf(” ¼Ç¼ºÅ ѧºÅ ÐÕÃû Êýѧ ¼ÆËã»ú Ó¢Óï ƽ¾ù·Ö\n”); printf(“%d”, rec);
p=p+rec-1;
printf(“%10s”, p->sno);
printf(“%10s”, p->sname); printf(“%10d”, p->math); printf(“%10d”, p->computer); printf(“%10d”, p->english); printf(“%10d\n”, p->average); printf(“°´ÈÎÒ»Òâ¼ü¼ÌÐø…”); getchar();
getchar(); }
/* °´Ñ§ºÅ²éѯº¯Êý*/ void query_sno(struct {
student_cj /******************begin*******************/
/*******************end********************/ }
/* °´ÐÕÃû²éѯº¯Êý*/
void query_sname(struct student_cj stud[ ]) {
/******************begin*******************/
stud[ ])

/*******************end********************/ }
/ * * * * ** * * ** * * ** * * ** * ** ** * * * * **
Îļþ student_update.c µÄ´úÂë:
* * * * * * * * * * * * * * * * * ** * * * * * * * * * * * */
# include
# include
# include
#include “student_head.h”
# define LEN sizeof(struct
extern reccount;

/* °´¼Ç¼ºÅÐ޸ĺ¯Êý*/
void update_rec(struct student_cj stud[ ]) {
int rec; printf(“ÇëÊäÈëÒªÐ޸ĵļǼºÅ:”); scanf(“%d”, &rec);
if(rec<1 || rec>reccount)
{
printf(“ÊäÈë´íÎó!\n”);
return; }
rec–;
printf(“\n ÐÞ¸ÄÇ°µÄÊý¾ÝΪ:\n”); printf(“ѧºÅ:%s\n”, stud[rec].sno); printf(“ÐÕÃû:%s\n”, stud[rec].sname); printf(“Êýѧ:%d\n”, stud[rec].math); printf(“¼ÆËã»ú:%d\n”, stud[rec].computer); printf(“Ó¢Óï:%d\n”, stud[rec].english); printf(“\n ÇëÊäÈëÐ޸ĺóµÄÊý¾Ý:\n”);
printf(“ÐÕÃû:”);
student_cj)

scanf(“%s”, stud[rec].sname); printf(“Êýѧ:”);
scanf(“%d”, &stud[rec].math); printf(“¼ÆËã»ú:”);
scanf(“%d”, &stud[rec].computer); printf(“Ó¢Óï:”);
scanf(“%d”, &stud[rec].english);
stud[rec].average= (stud[rec].math+ stud[rec].computer+ stud[rec].english)/3.0;
}
{
/******************begin*******************/
/*******************end********************/ }
/* °´ÐÕÃûÐ޸ļǼµÄº¯Êýº¯ÊýÃû: update_sname(struct void update_sname(struct student_cj stud[ ])
{
/******************begin*******************/
/*******************end********************/ }
/* °´Ñ§ºÅÐ޸ļǼµÄº¯Êýº¯ÊýÃû: update_sno(struct void update_sno(struct student_cj stud[ ])
student_cj
stud[ ])*/
student_cj
stud[ ])*/