Tham khảo tài liệu 'tự học lập trình pascal tập 2 part 7', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 90 Pascal dành cho học sinh Begin imin 1 For i j 1 to 10 do If a imin a i then imin i atg aíil aỊj a imin a imin atg End ig 10 1 div2 chỉ vào giữa dãy Writeln Phần tử ở giữa nhất là a ig Readln End. 10. Program P2510 Uses Crt Var a .array 1 .100 of integer n j j kikniax id byte Begin Clrscr Write Nhập độ dài của dãy Readln n For i 1 to n do Begin Writer afj - Readln a i End kmax 0 For i 1 to n do Begin j i Phẩn 2. HƯỚNG DAN 91 white a i a j do inc i k j-i If k kmax then Begin kmax k id i End End . Writeln Dãy con liền nhau cực đại các phần tử bằng nhau của dãy For i id to id kmax-1 do Write a i 4 Readỉn End. 11. Program P2511 Var n i us word Begin Write Nhập n Readln n For i 1 to n -1 do If n mod i 0 then us i If us 0 then Writelnf ước số thực sự lớn nhất của n là us Else Writelnf Không có ước số thực sự Readln End. 12. Program P2512 Var n i us word Begin Write Nhập n Readln n 92 Pascal dành cho học sinh For i n downto 2 do If n mod i 0 then us i If us 0 then Writeln ước số nhỏ nhất của n không phải đơn vị là us Else Writeln Không có ước số thực sự Readln End. 13. Program P2513cach1 Var b a array 1. 100 of integer n i j imin byte atg integer Begin Wiite Nhập độ dài của dãy n Readln n For i 1 to n do Begin Write a i 2 1 Readln a i End For j 1 to n-1 do sắp xếp lại dãy 1 Begin lmin j For i j 1 to n do lfa imin a i then imin i atg a j a j a imin a imin atg End b 1 a 1 ghi phần tử đầu tiên của dãy 2