Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 86 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
86
Dung lượng
419,56 KB
Nội dung
! " #" $ %&'( ) *+ ", -* /0 12 34 " 63 7 * *+ ",$ % '!: ; *+ ",-* 9143< " 63 7 < " 9# = *+ ", > ? ) *+ ", @A " @A B C *+ D$ /B @E F @A B G $ H @A I7J H K L ) M$ ! C *+ D' , K # N O # , P T* U 'V" '$$$ W@A I 7J O*6 !* " &' E X # , P Y @A D ? @A # , P @E \ ," ? M ? V" K -* V" [[ &$ $ V" • • _ M O 6Z# ? O* # Q F , )# )# N [[$ ] ` , 1V" 8$ I7J " 8' ," ? C6Z# ? Q @R / L* = D ' C6Z# ? V" $ M ^ ? M " *R V $abaR )# U ] O* U P " H "c H " @ 6"# a " ' d F NM Y , ; @e ? '7f @e ? ' g @e ? '$$$ , )# h$i j @A B , )# , U P*' , '$$$ , )# M @ )# Q* O8R l " @ J • , )# h$m4VR @e ? $ • , )# h$ @A " (` 7J GG > › > p› = ž> › = ž " = ", I P } {# ", Q G • d } {# } {# < } {# b< } {# ]" f ,1 z f # ]1 ¡ ∼ ŸŸ rr ¢& › @ , f l C H j * L# 8$ , ", I M " _ R (` 7JR # {# ]" &› d H , * 8' H " _ R } {# ", ( 12 i"x 1< } Y f >>> >>>> >>>> >> >> p> " , Q , f # z 1> T* ƒ X ) # {# R >G>›> >G ›> G>›> G › (` 7JR & G p >>>> >>>> >>>> >> & >>>> >>>> >>>> > > p 5555555555555555555555555555555 U9 -*]R T* ƒ >>>> >>>> >>>> >>> X ) # {# < R > >›> > › >› › T* ƒ X ) # {# b< R >¡>›> >¡ › ¡>› ¡ ›> , # {# 7f *MP R ŸŸ › h1 rr › „1 V P i 7J % & 45 ( M H "c @e ? ^N B Q * u @A ? M J P " V J& O( ( /H @e ? [ @A L# , ,# N H 6N " F P I 7J @e ; $ ,"' f *$ @ @ F L* = R #include < > /* G•i t•p tiêu •• ch••ng trình */ #define /* Khai báo h•ng s• */ typedef /* ••nh ngh•a ki•u d• li•u */ /* Nguyên m•u hàm: khai báo tên h•m tham s• */ /* Khai báo bi•n tồn c•c */ p O*6N ' | 6N I d I 7J main() { /* Khai báo bi•n */ /* Các câu l•nh */ } /* ••nh ngh•a hàm */ @ 9' " H @e ? ' F P O*# N U , *R U ],# N M O*6 oM B F P F "x U 8' f d ` " H @e ? 'f d # ƒ *H $ (` 7JR @e ? e ] ,"' f #$ i d'$$$ !L #6 L$ main() { } @e "$ MU !" L* = * M ^ E )* H Y U 6) V ? ( ? ]' @ y U ," 6|' ; H H @e ," e (` 7JR B Q# Q* OR 7o (` 7JR f ? 'F ]'j , U O* 6"c U ," U P* P f d l P I7J , d , l ? ' , )# Q* O M d$ Z# „ v*L , ," U , *' " # N u @A ? M *$ ; , *+ $ "$ /2b › >>>$ ()*$# */2b >>> + 6: /* I7J = # ,#R (` 7JR H ' ƒ *H # ] U U P*t7 t6 )* # '• $ m@*€'U U ," @E $ t, t • „h U ," "t * • „h U ," U P* = " ," = *MQ h„ PU X h„ c" , f " F @ *R ' › >>• + F ; , z* H 7o P B , )# Q* O " @e *+ "x , 7" @ I7J f 89 ? FU PU ()*$# * ," l ' "x I7J Q tl ()*$# * "x I7J ,t ft l p U F @ *R U P*t7 t6 )* Q t l › ,t ft l (` 7JR ()*$# * }4 S6" < = > ? 4: • , 6) • Wx Q • Q &$ }4 › &$ % & o F Q @A " , c 6@A Q ,6 F Q £ F` ] ` € H 7B $ d' A E$ 9* N $ @A0 /H Z , f -* # {# , E 7L*C›D$ (` 7JR › • „h Z , f h„ › [ • „h Z , f P* ; [ ; , h„ = # ,# # {# , R Q t Y3 › P*t ; • Y3 › › › • „h , v › [ 1M › &8• , f „h M " ]& Z ' ' h„ , f &' * Fv Z , f Y P* ; [ M' d h„ ( Y3 K W G \ E # {# M ] , f ' B @ *R › [ • @A B [[ã "x [[ ã Ô ã @A B 55• "x 55 • 3X U , * [[ [[ "x P* ; ; [[ 155 ? u @A u @A , @E U ] 8$ 55 55 " ] @E U # {# , R Q t › P*t ; $ 9* , ' 9* P* ; ; [[ 558 ? (` 7JR v 6Q v › p• M › v[[• „h , v l p' , M l v › p• M › [[v• „h , v l p' v , f p8' * F h„ , f •8 h„ b{ # {# , *R › &• › [ 55 • p& v 6Q ' * F , M l v W"c @e ? * u " # {# ` : 6@e Y >> z R double s = 0; int i; for (i = 0; i < 100; i++) s += nhan_cong[i].luong; V X (J& O( " w 7o = $ (` 7J = P ; f F PU ^$ @ 9' " w y @A 7o ," " w L* = @ *R P ; f ^Y H L* Nhan_su *p, *p1, *p2, nc1, nc2, m[100]; !" F'3G3 L* = $ , # {# , , " * zM u6 w L* = ' j ( ( , L* = ' 1R ] A# 6)R p1 = &nc1; p2 = &m[1]; p = m; @ U *R ," " w L* = ' ? !Q t " t w5r F , *M Z# , # N L* = l " w t# N i"x R 1h!Q t " t w8$ (` 7J' , , t# N *6 @e @e R nc1.Luong ⇔ p1->Luong ⇔ (*p1).Luong V V E ! Rj 1i ? • ; Y F P6 R V L* = 'U • " • /] = $ i (J& O( F w L* = 'U L* = F "x " X @e ; X @e w L* = 'U ; F H , f L* = $ f ^Y X @e L* = $ ; Q ] L* F P ] OR • • \ , f L* = " w L* = (` 7JR @e Z 6@e 8$ z $ ? 7@E zM -*] 6€ H , , z @e ? X ) R Z# )*' ƒ# v9# #include #include #include p _ " BQ ' R BQ , , #define N 100 typedef struct { char hoten[30]; float bacluong; } Nhan_Cong; void nhap(Nhan_Cong *nc); void xuat(Nhan_Cong nc); void sapxep(Nhan_Cong *p, int n); void hoanvi(Nhan_Cong *p1, Nhan_Cong *p2); main() { Nhan_Cong ds[N]; int i, n; clrscr(); printf(“Nhap so nhan cong: ”); scanf(“%d”, &n); for(i = 0; i : % P 6E e $> : R#? R0# ? < F * L# )#' B ' '$$$ " = L O* , f d • H L* = U P* )# " )# Q* OŸR }$ , )# # z$ ! " ? B M = ^? < KL " , Q " @ I7J ‡4ma @A 6"cR )# P* , vI6€ E )# , )# ' @R )#' KU9 = )# a ! @E U /H 7j @e ? F , vI 6€ )# ' = Z# U , ]M @ H " w H L* = $ F & 7j R R 'R & 'R 1' $ • • 7"* < P 7 #*8 @A 7 "*#*8 E # ` 7 ) 7j ]M @A ]M 8$ B P B$ " @A E ? P $ d * *M Z# ^3' cd E = # ,# @ H )#' N # ] )# @E $ / )# @A X ) *R FILE * fopen(const char *name, const char *mode) • ! N 8$ '6 • ! *| U` X 1' Q *| U` X )# N ^ U P* F P# ] )#' ^w ] @ 1' F P6 H 7k 9* " *| *R o CDR )# o C•DR )# o C DR U )# c" )# ] P B )# # ] _ c' 9*U ] P ] E8 o C[D "x C•[DR o C [DR • i )# M ] O" (` 7JR #include FILE *fp; P )# ] P B„ w )# 9* ," 6|8 ‚ 9* )# K _ c' 9*U " * )# * c" )# E8 9* )# _ c' 9* ] P B„ * )# ' 9*U ] O" w ~mm$ if ((fp = fopen("dulieu.txt","r")) == NULL) { fprintf(stderr,"Khơng th• m• t•p dulieu.txt\n"); exit(1); } 9* " w )# N F $ ' @A 6c ] Oa• N " )# w )# i ^3& R *| R 6Q )#' 9* F6| 9* x# * )# U &67 -& )( ' @A 6c ] Oa