ºÝºÝߣ
Submit Search
Ctdl 2002
?
0 likes
?
119 views
H? L?i
Follow
1 of 2
Download now
Download to read offline
More Related Content
Ctdl 2002
1.
1/2 B? GI?O D?C
& ??O T?O H? v¨¤ t¨ºn th¨ª sinh:.................................................. ??I H?C HU? S? b¨¢o danh:.................................................. K? THI TUY?N SINH SAU ??I H?C N?M 2002 M?n thi: Ng?n ng? l?p tr¨¬nh (D¨¤nh cho cao h?c) Th?i gian l¨¤m: 180 ph¨²t C?u 1. Cho khai b¨¢o m?t danh d¨¢ch li¨ºn k?t ??n nh? sau: type TroNut=^Nut; Nut=record giatri:integer; t end; iep:TroNut; var First:TroNut; Vi?t th? t?c ?? quy: procedure InNguoc(First:TroNut); th?c hi?n vi?c in gi¨¢ tr? (tr??ng giatri) c¨¢c n¨²t theo th? t? ng??c l?i. C?u 2. Ng??i ta bi?n di?n th?ng tin v? c¨¢c nh?c s? d??i d?ng m?t c?y nh? ph?n t¨¬m ki?m c¨® kho¨¢ TenNS (t¨ºn nh?c s?). M?i n¨²t c?a c?y l¨¤ m?t b?n ghi g?m tr??ng TenNS v¨¤ 3 tr??ng con tr?: Left, Right, First. Hai con tr? Left v¨¤ Right l?n l??t tr? t?i hai n¨²t con tr¨¢i v¨¤ con ph?i c?a n¨²t ?¨®, con tr? First tr? t?i ph?n t? ??u c?a m?t danh s¨¢ch li¨ºn k?t ??n ch?a th?ng tin c¨¢c b?n nh?c c?a nh?c s?. M?i ph?n t? c?a danh s¨¢ch n¨¤y l¨¤ m?t b?n ghi g?m 3 tr??ng: TenBH (t¨ºn b¨¤i h¨¢t), Nam (n?m ra ??i b¨¤i h¨¢t) v¨¤ Next (l?u ??a ch? c?a ph?n t? ti?p theo trong danh s¨¢ch). Danh s¨¢ch n¨¤y ???c s?p theo th? t? t?ng d?n c?a Nam. Ng??i ta cho khai b¨¢o c?a c?u tr¨²c d? li?u n¨®i tr¨ºn nh? sau: type St25=String[25]; TroNP=^Nhacphan; NhacPham=record TenBH:String; Nam:word; Next:TroNP; end; TroNS=^nut; Nut=record TenNS:st25; First:TroNP; Left,Right:TroNS; end; var Top:TroNS; 1. Vi?t h¨¤m Function NumSong(Name:st25):byte; tr? v? c¨¢c nh?c ph?m c?a nh?c s? c¨® t¨ºn Name. 2. Vi?t th? t?c Tr¨¬nh b¨¤y: Tr?n Ho¨¤i Nh?n
2.
2/2 Procedure LastSong(Name:St25); in l¨ºn
c¨¢c b¨¤i h¨¢t ra ??i trong n?m cu?i c¨´ng (trong danh s¨¢ch) c?a nh?c s? c¨® t¨ºn Name. C?u 3. Cho m?t ch??ng tr¨¬nh vi?t theo Pascal nh? sau: var x:integer; Procedure Them2Bot1(var x:integer; y:integer); begin writeln(x,y:4); inc(x,2); if y>0 then begin dec(y); Them2Bot1(x,y); end; writeln(x,y:4); end; BEGIN x:=5;Them2Bot1(x,x); END. H?y vi?t c¨¢c k?t qu? in ra khi th?c hi?n ch??ng tr¨¬nh tr¨ºn. C?u 4. Vi?t ch??ng tr¨¬nh ??c v¨¤o m?t s? t? nhi¨ºn n, sau ?¨® cho in ra t?t c? c¨¢c s? nguy¨ºn t? kh?ng nh? h?n 2 v¨¤ kh?ng l?n h?n n. Ghi ch¨²: C¨¢n b? coi thi kh?ng ???c gi?i th¨ªch g¨¬ th¨ºm. Tr¨¬nh b¨¤y: Tr?n Ho¨¤i Nh?n
Download