<!DOCTYPE html>
    <html lang="vi" xmlns="http://www.w3.org/1999/xhtml" prefix="og: http://ogp.me/ns#">
    <head>
<title>Lập trình trò chơi quân cờ trong Pascal - Sách Giải</title>
<meta name="description" content="Môn học">
<meta name="keywords" content="môn học">
<meta name="news_keywords" content="môn học">
<meta name="author" content="Sách Giải">
<meta name="copyright" content="Sách Giải [sachgiai2015@gmail.com]">
<meta name="robots" content="index, archive, follow, noodp">
<meta name="googlebot" content="index,archive,follow,noodp">
<meta name="msnbot" content="all,index,follow">
<meta name="generator" content="NukeViet v4.5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="og:title" content="Lập trình trò chơi quân cờ trong Pascal">
<meta property="og:type" content="website">
<meta property="og:description" content="Môn học">
<meta property="og:site_name" content="Sách Giải">
<meta property="og:url" content="https://sachgiai.com/savefile/Tin-hoc/lap-trinh-tro-choi-quan-co-trong-pascal-13465.html">
<link rel="shortcut icon" href="https://sachgiai.com/favicon.ico">
<link rel="canonical" href="https://sachgiai.com/savefile/Tin-hoc/lap-trinh-tro-choi-quan-co-trong-pascal-13465.html">
<link rel="alternate" href="https://sachgiai.com/rss/" title="Môn học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-1/" title="Môn học - Lớp 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-1/" title="Môn học - Tiếng Việt 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-1/" title="Môn học - Toán 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-the-chat-1/" title="Môn học - Giáo dục thể chất 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/my-thuat-1/" title="Môn học - Mỹ thuật 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-1-ctst/" title="Môn học - Tiếng Việt 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-1-ctst/" title="Môn học - Toán 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu/" title="Môn học - Cánh diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/am-nhac-1/" title="Môn học - Âm nhạc 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-the-chat-1-cd/" title="Môn học - Giáo dục thể chất 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoat-dong-trai-nghiem-1/" title="Môn học - Hoạt động trải nghiệm 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-1-cd/" title="Môn học - Toán 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tu-nhien-va-xa-hoi-1/" title="Môn học - Tự nhiên và xã hội 1" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-2/" title="Môn học - Lớp 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-2/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-2/" title="Môn học - Toán 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-2/" title="Môn học - Tiếng Việt 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-51/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-2-ctst/" title="Môn học - Tiếng Việt 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-2-ctst/" title="Môn học - Toán 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-2/" title="Môn học - Cánh diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-2-cd/" title="Môn học - Toán 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-2-cd/" title="Môn học - Tiếng Việt 2" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-3/" title="Môn học - Lớp 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-3/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-3/" title="Môn học - Tiếng Việt 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-3/" title="Môn học - Toán 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-3/" title="Môn học - Cánh diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-3-cd/" title="Môn học - Tiếng Việt 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-3-cd/" title="Môn học - Toán 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-3/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-3-ctst/" title="Môn học - Tiếng Việt 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-3-ctst/" title="Môn học - Toán 3" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-4/" title="Môn học - Lớp 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-4/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-4/" title="Môn học - Tiếng Việt 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-4/" title="Môn học - Toán 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-4/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-4-ctst/" title="Môn học - Tiếng Việt 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-4-ctst/" title="Môn học - Toán 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-4/" title="Môn học - Cánh diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-4-cd/" title="Môn học - Tiếng Việt 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-4-cd/" title="Môn học - Toán 4" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-5/" title="Môn học - Lớp 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-5/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-5/" title="Môn học - Tiếng Việt 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-5/" title="Môn học - Toán 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-5/" title="Môn học - Cánh diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-5-cd/" title="Môn học - Tiếng Việt 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-5-cd/" title="Môn học - Toán 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-5/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-viet-5-ctst/" title="Môn học - Tiếng Việt 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-5-ctst/" title="Môn học - Toán 5" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-6/" title="Môn học - Lớp 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-6/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-6/" title="Môn học - Ngữ Văn 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-6/" title="Môn học - Toán 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-6-global-success/" title="Môn học - Tiếng Anh 6 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-va-dia-li-6/" title="Môn học - Lịch sử và Địa lí 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-cong-dan-6/" title="Môn học - Giáo dục công dân 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-6/" title="Môn học - Tin học 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-6/" title="Môn học - Cánh diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-cong-dan-6-cd/" title="Môn học - Giáo dục công dân 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-6-cd/" title="Môn học - Ngữ Văn 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-6-cd/" title="Môn học - Toán 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-6/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-6-ctst/" title="Môn học - Ngữ Văn 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-6-ctst/" title="Môn học - Toán 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-cong-dan-6-ctst/" title="Môn học - Giáo dục công dân 6" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-7/" title="Môn học - Lớp 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-7/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-7/" title="Môn học - Ngữ Văn 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-7/" title="Môn học - Toán 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-7-global-success/" title="Môn học - Tiếng Anh 7 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-cong-dan-7/" title="Môn học - Giáo dục công dân 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-va-dia-li-7/" title="Môn học - Lịch sử và Địa lí 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/khoa-hoc-tu-nhien-7/" title="Môn học - Khoa học tự nhiên 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-7/" title="Môn học - Tin học 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-7/" title="Môn học - Công nghệ 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-7/" title="Môn học - Cánh Diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-7-cd/" title="Môn học - Ngữ Văn 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-7-cd/" title="Môn học - Toán 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/khoa-hoc-tu-nhien-7-cd/" title="Môn học - Khoa học tự nhiên 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-7/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-7-ctst/" title="Môn học - Ngữ Văn 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-7-ctst/" title="Môn học - Toán 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/mi-thuat-7-ctst/" title="Môn học - Mĩ thuật 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/am-nhac-7-ctst/" title="Môn học - Âm nhạc 7" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-8/" title="Môn học - Lớp 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-8/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-8/" title="Môn học - Ngữ Văn 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-8/" title="Môn học - Toán 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/khoa-hoc-tu-nhien-8/" title="Môn học - Khoa học tự nhiên 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-cong-dan-8/" title="Môn học - Giáo dục công dân 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-8/" title="Môn học - Tin học 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-va-dia-li-8/" title="Môn học - Lịch sử và Địa lí 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-8/" title="Môn học - Công nghệ 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-8-global-success/" title="Môn học - Tiếng Anh 8 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-8/" title="Môn học - Cánh Diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-8-cd/" title="Môn học - Ngữ Văn 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-8-cd/" title="Môn học - Toán 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-dan-8-cd/" title="Môn học - Công Dân 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-8/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-8-ctst/" title="Môn học - Ngữ Văn 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-8-ctst/" title="Môn học - Toán 8" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-9/" title="Môn học - Lớp 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-9/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-9/" title="Môn học - Ngữ Văn 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-9/" title="Môn học - Toán 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/khoa-hoc-tu-nhien-9/" title="Môn học - Khoa học tự nhiên 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/giao-duc-cong-dan-9/" title="Môn học - Giáo dục công dân 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-9/" title="Môn học - Tin học 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-va-dia-li-9/" title="Môn học - Lịch sử và Địa lí 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-9-global-success/" title="Môn học - Tiếng Anh 9 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-9/" title="Môn học - Công nghệ 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-9/" title="Môn học - Cánh Diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-9-cd/" title="Môn học - Ngữ Văn 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-9-cd/" title="Môn học - Toán 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-9/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-9-ctst/" title="Môn học - Ngữ Văn 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-9-ctst/" title="Môn học - Toán 9" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-10/" title="Môn học - Lớp 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-10/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-10/" title="Môn học - Ngữ Văn 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-10/" title="Môn học - Toán 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-10/" title="Môn học - Kinh tế và Pháp luật 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-10-global-success/" title="Môn học - Tiếng Anh 10 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-10/" title="Môn học - Lịch Sử 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-10/" title="Môn học - Địa Lí 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-10/" title="Môn học - Vật Lí 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-10/" title="Môn học - Hoá học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-10/" title="Môn học - Sinh học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-trong-trot-10/" title="Môn học - Công nghệ trồng trọt 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-thiet-ke-10/" title="Môn học - Công nghệ thiết kế 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/quoc-phong-va-an-ninh-10/" title="Môn học - Quốc Phòng và An Ninh 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-10/" title="Môn học - Tin học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-10/" title="Môn học - Cánh Diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-10-cd/" title="Môn học - Ngữ Văn 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-10-cd/" title="Môn học - Toán 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-10-cd/" title="Môn học - Kinh tế và Pháp luật 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-10-cd/" title="Môn học - Tin học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-10-cd/" title="Môn học - Hoá học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-10-cd/" title="Môn học - Lịch sử 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-10-cd/" title="Môn học - Địa Lí 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-10-cd/" title="Môn học - Sinh học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-10-cd/" title="Môn học - Vật lí 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-10-explore-new-worlds/" title="Môn học - Tiếng Anh 10 Explore New Worlds" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-trong-trot-10-cd/" title="Môn học - Công nghệ trồng trọt 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-thiet-ke-10-cd/" title="Môn học - Công nghệ thiết kế 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-10/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-10-ctst/" title="Môn học - Ngữ Văn 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-10-ctst/" title="Môn học - Toán 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-10-ctst/" title="Môn học - Lịch Sử 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-10-ctst/" title="Môn học - Địa Lí 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-10-ctst/" title="Môn học - Sinh học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-10-ctst/" title="Môn học - Vật Lí 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-10-ctst/" title="Môn học - Hoá học 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/quoc-phong-va-an-ninh-10-ctst/" title="Môn học - Quốc Phòng và An Ninh 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-10-ctst/" title="Môn học - Kinh tế và Pháp luật 10" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-10-friends-plus/" title="Môn học - Tiếng Anh 10 Friends plus" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-11/" title="Môn học - Lớp 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-11/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-11/" title="Môn học - Ngữ Văn 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-11/" title="Môn học - Toán 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-11/" title="Môn học - Hoá học 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-11/" title="Môn học - Sinh học 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-11/" title="Môn học - Địa Lí 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-11/" title="Môn học - Lịch Sử 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-11/" title="Môn học - Vật Lí 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-11/" title="Môn học - Kinh tế và Pháp luật 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-11-chan-nuoi/" title="Môn học - Công nghệ 11 Chăn nuôi" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-11-co-khi/" title="Môn học - Công nghệ 11 Cơ khí" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-11-ung-dung/" title="Môn học - Tin học 11 Ứng dụng" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-11-khoa-hoc-may-tinh/" title="Môn học - Tin học 11 Khoa học máy tính" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-11-global-success/" title="Môn học - Tiếng Anh 11 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-11/" title="Môn học - Cánh Diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-11-cd/" title="Môn học - Ngữ Văn 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-11-cd/" title="Môn học - Toán 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-11-cd/" title="Môn học - Hoá học 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-11-cd/" title="Môn học - Lịch Sử 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-11-cd/" title="Môn học - Địa Lí 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-11-cd/" title="Môn học - Sinh học 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-11-cd/" title="Môn học - Vật Lí 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-11-ung-dung-cd/" title="Môn học - Tin học 11 Ứng dụng" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-11-khoa-hoc-may-tinh-cd/" title="Môn học - Tin học 11 Khoa học máy tính" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-11-explore-new-worlds/" title="Môn học - Tiếng Anh 11 Explore New Worlds" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/quoc-phong-va-an-ninh-11-cd/" title="Môn học - Quốc phòng và An ninh 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-11-cd/" title="Môn học - Kinh tế và Pháp luật 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-11-chan-nuoi-cd/" title="Môn học - Công nghệ 11 Chăn nuôi" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-11-co-khi-cd/" title="Môn học - Công nghệ 11 Cơ khí" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-11/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-11-ctst/" title="Môn học - Ngữ Văn 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-11-ctst/" title="Môn học - Toán 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-11-ctst/" title="Môn học - Địa Lí 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-11-ctst/" title="Môn học - Hoá học 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-11-ctst/" title="Môn học - Sinh học 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-11-ctst/" title="Môn học - Lịch Sử 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-11-ctst/" title="Môn học - Kinh tế và Pháp luật 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-11-friends-plus/" title="Môn học - Tiếng Anh 11 Friends plus" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-11-ctst/" title="Môn học - Vật Lí 11" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lop-12/" title="Môn học - Lớp 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ket-noi-tri-thuc-12/" title="Môn học - Kết nối tri thức" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-12/" title="Môn học - Ngữ Văn 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-12/" title="Môn học - Toán 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/dia-li-12/" title="Môn học - Địa Lí 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/hoa-hoc-12/" title="Môn học - Hoá học 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/lich-su-12/" title="Môn học - Lịch Sử 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/sinh-hoc-12/" title="Môn học - Sinh học 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/vat-li-12/" title="Môn học - Vật Lí 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tieng-anh-12-global-success/" title="Môn học - Tiếng Anh 12 Global Success" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-12-ung-dung/" title="Môn học - Tin học 12 Ứng dụng" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tin-hoc-12-khoa-hoc-may-tinh/" title="Môn học - Tin học 12 Khoa học máy tính" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/kinh-te-va-phap-luat-12/" title="Môn học - Kinh tế và Pháp luật 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-12-chan-nuoi/" title="Môn học - Công nghệ 12 Chăn nuôi" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/cong-nghe-12-co-khi/" title="Môn học - Công nghệ 12 Cơ khí" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/canh-dieu-12/" title="Môn học - Cánh Diều" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-12-cd/" title="Môn học - Ngữ Văn 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-12-cd/" title="Môn học - Toán 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/chan-troi-sang-tao-12/" title="Môn học - Chân trời sáng tạo" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/ngu-van-12-ctst/" title="Môn học - Ngữ Văn 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/toan-12-ctst/" title="Môn học - Toán 12" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Toan-hoc/" title="Môn học - Toán học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Van-hoc/" title="Môn học - Văn học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Vat-ly/" title="Môn học - Vật lý" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Hoa-hoc/" title="Môn học - Hoá học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Lich-su/" title="Môn học - Lịch sử" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Dia-ly/" title="Môn học - Địa lý" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Anh-van/" title="Môn học - Anh văn" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Cong-nghe/" title="Môn học - Công nghệ" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Sinh-hoc/" title="Môn học - Sinh học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Tin-hoc/" title="Môn học - Tin học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Am-nhac/" title="Môn học - Âm nhạc" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Mi-thuat/" title="Môn học - Mĩ thuật" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/The-duc/" title="Môn học - Thể dục" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Cong-dan/" title="Môn học - Công dân" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/khoa-hoc/" title="Môn học - Khoa học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Y-khoa/" title="Môn học - Y khoa" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Ngoai-khoa/" title="Môn học - Ngoại khoá" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Guong-sang/" title="Môn học - Gương sáng" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/De-thi-dap-an/" title="Môn học - Đề thi, đáp án" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Tho-van/" title="Môn học - Thơ văn" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/De-tai/" title="Môn học - Đề tài" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Day-va-hoc/" title="Môn học - Dạy và học" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/Hoi-dap/" title="Môn học - Hỏi đáp" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/doc/" title="Môn học - Văn bản" type="application/rss+xml">
<link rel="alternate" href="https://sachgiai.com/rss/tong-hop/" title="Môn học - Tổng hợp" type="application/rss+xml">
<link rel="preload" as="style" href="https://sachgiai.com/assets/css/font-awesome.min.css" type="text/css">
<link rel="preload" as="style" href="https://sachgiai.com/themes/whitebook/css/bootstrap.min.css" type="text/css">
<link rel="preload" as="style" href="https://sachgiai.com/themes/whitebook/css/style.css" type="text/css">
<link rel="preload" as="style" href="https://sachgiai.com/themes/whitebook/css/style.responsive.css" type="text/css">
<link rel="preload" as="style" href="https://sachgiai.com/themes/whitebook/css/news.css" type="text/css">
<link rel="preload" as="style" href="https://sachgiai.com/themes/whitebook/css/custom.css" type="text/css">
<link rel="preload" as="script" href="https://sachgiai.com/assets/js/jquery/jquery.min.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/assets/js/language/vi.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/assets/js/DOMPurify/purify3.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/assets/js/global.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/assets/js/site.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/themes/whitebook/js/news.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/themes/whitebook/js/main.js" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/themes/whitebook/js/custom.js" type="text/javascript">
<link rel="preload" as="script" href="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" type="text/javascript">
<link rel="preload" as="script" href="https://www.googletagmanager.com/gtag/js?id=G-1KVL9TDN71" type="text/javascript">
<link rel="preload" as="script" href="https://sachgiai.com/themes/whitebook/js/bootstrap.min.js" type="text/javascript">
<link rel="stylesheet" href="https://sachgiai.com/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="https://sachgiai.com/themes/whitebook/css/bootstrap.min.css">
<link rel="stylesheet" href="https://sachgiai.com/themes/whitebook/css/style.css">
<link rel="stylesheet" href="https://sachgiai.com/themes/whitebook/css/style.responsive.css">
<link rel="StyleSheet" href="https://sachgiai.com/themes/whitebook/css/news.css">
<link rel="stylesheet" href="https://sachgiai.com/themes/whitebook/css/custom.css">
<style>
	body{background: #fff;}
</style>
<!-- Google Tag Manager -->
<!-- End Google Tag Manager -->
</head>
    <body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PMHW5CD"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<div id="print">
	<div id="hd_print">
		<h2 class="pull-left">Sách Giải</h2>
		<p class="pull-right"><a title="Sách Giải" href="https://sachgiai.com/">https://sachgiai.com</a></p>
	</div>
	<div class="clear"></div>
	<hr />
	<div id="content">
		<h1>Lập trình trò chơi quân cờ trong Pascal</h1>
		<ul class="list-inline">
			<li>Chủ nhật - 09/08/2020 09:59</li>
			<li class="hidden-print txtrequired"><em class="fa fa-print">&nbsp;</em><a title="In ra" href="javascript:;" onclick="window.print()">In ra</a></li>
			<li class="hidden-print txtrequired"><em class="fa fa-power-off">&nbsp;</em><a title="Đóng cửa sổ này" href="javascript:;" onclick="window.close()">Đóng cửa sổ này</a></li>
		</ul>
		<div class="clear"></div>
		<div id="hometext">
			Trên một bàn cờ n x m có đặt n quân xe trắng và n quân xe đen sao cho trên mỗi cột đều có 1 xe trắng và 1 xe đen. Hai người A, B chơi với nhau một trò chơi như sau:<br />- A đi xe trắng, B đi xe đen.<br />- Các quân xe không ăn nhau, không được đi qua đầu nhau và chỉ được di chuyển trên một cột.<br />Hãy lập trình để máy tính chơi với người trò chơi trên với khả năng thắng cao nhất.
		</div>
		<div id="bodytext" class="clearfix">
			<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><b><i><u><img alt="" height="364" src="https://sachgiai.com/uploads/news/2020_07/bai-toan-quan-co.jpg" width="500" /><br />
Hướng dẫn:</u></i></b></span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Có thể đưa về bài toán bốc sỏi.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Khoảng cách giữa 2 xe chính là số sỏi.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">- Chú ý rằng số sỏi có thể tăng hoặc giảm.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">Chương trình PASCAL chi tiết như sau:</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">uses crt;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">const max=20;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mu: array&#91;0..4&#93; of byte = (1,2,4,8,16);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">type d=array&#91;1..5&#93; of 0..1;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">var i,n,k,l,j,m, where1, where2, that, new1, new2: byte; may, người: 1..2; </span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a: array&#91;l..max,l..maxj of 0..2;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; have: array&#91;l..max&#93; of byte;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cot: set of byte;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b : d;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; suly: array&#91;1..max&#93; of d;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; truoc,trang,error,stop: boolean;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">procedure draw;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textbackground(11);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(15);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clrscr,</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i : = 1 to n do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(14);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(30-n,i+12-(n div 2));Write(i: 3);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(30+i * 3-n,12-(n div 2));Write(i: 3);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For j : = 1 to n do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(31+i * 3-n,J+12-(n div 2));</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if a&#91;i,j&#93;=o then.</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(7);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Writer (‘</span></span></span><img alt="" height="25" src="https://sachgiai.com/uploads/news/2020_08/image-20200809205905-1.png" width="13" /><span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><span style="font-size:14.0pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,&#039;serif&#039;"><span style="position:relative"><span style="top:4.5pt"> </span></span></span></span></span>&nbsp;</span></span></span><img alt="" height="25" src="https://sachgiai.com/uploads/news/2020_08/image-20200809205905-2.png" width="13" /><span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><span style="font-size:14.0pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,&#039;serif&#039;"><span style="position:relative"><span style="top:4.5pt"> </span></span></span></span></span>’);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if a&#91;ij&#93;=l then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(15);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Writer (‘</span></span></span><img alt="" height="25" src="https://sachgiai.com/uploads/news/2020_08/image-20200809205905-3.png" width="13" /><span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><span style="font-size:14.0pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,&#039;serif&#039;"><span style="position:relative"><span style="top:4.5pt"> </span></span></span></span></span>&nbsp;</span></span></span><img alt="" height="25" src="https://sachgiai.com/uploads/news/2020_08/image-20200809205905-4.png" width="13" /><span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><span style="font-size:14.0pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,&#039;serif&#039;"><span style="position:relative"><span style="top:4.5pt"> </span></span></span></span></span>’);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if a&#91;ij&#93;=2 then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(0);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writer (‘</span></span></span><img alt="" height="25" src="https://sachgiai.com/uploads/news/2020_08/image-20200809205905-5.png" width="13" /><span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><span style="font-size:14.0pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,&#039;serif&#039;"><span style="position:relative"><span style="top:4.5pt"> </span></span></span></span></span>&nbsp;</span></span></span><img alt="" height="25" src="https://sachgiai.com/uploads/news/2020_08/image-20200809205905-6.png" width="13" /><span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif"><span style="font-size:14.0pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,&#039;serif&#039;"><span style="position:relative"><span style="top:4.5pt"> </span></span></span></span></span>’);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; procedure init;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var ch: char;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stop: = false;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fillchar(a,sizeof(a),0);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Writeln(‘Nhap kich thuoc n&#039;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readln(n);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until (n&gt;0) and (n&lt;21);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Writeln (&#039;Nhap gia tri k’);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readln(m);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until (m&gt;0) and (m&lt;= n);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i : = 0;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cot : = &#91;&#93;;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j: = random(n)+1;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (not (j in cot)) then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i : = i+1;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cot : = cot+&#91;j&#93;;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k: = random(n)+l;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1: = random(n)+l;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until 1&lt; &gt; k;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&#91;j,k&#93; : = 1;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&#91;j,1&#93; : = 2;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until i=m;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; draw;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readln;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textbackground(0);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(15)</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clrscr;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Writeln(‘Ban muon di quan trang hay den &lt;1&gt;: trang, &lt;2&gt;: den&#039;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;ch : = readkey;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ch = “1&#039; then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nguoi : = 1;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; may : = 2;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; trang : = true;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ch = &#039;2&#039; then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nguoi : = 2;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;may : - 1;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; trang : = false;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until (ch in &#91;&#039;1&#039;,&#039;2&#039;&#93;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Writeln(‘Ban muon di truoc hay di sau &lt;1 &gt;: truoc, &lt;2&gt;: sau&#039;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ch: = readkey;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ch=&#039;1&#039; then truoc : = true;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ch=&#039;2&#039; then truoc : = false;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until (ch in &#91;&#039;1&#039;,&#039;2&#039;1)1;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">procedure nguoidi;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">var ch: char;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; draw;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; stop : = true;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; for i : = 1 to n do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if i in cot then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for j : = 1 to n do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (a&#91;i,j&#93;=may) then where2 : = j;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (a&#91;i,j&#93;=nguoi) then where1: - j;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; have&#91;i&#93;: = abs(where2-where1)-1;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (have&#91;i&#93;&lt; &gt;0) or ((where1-n)*(where1-1)&lt; &gt;0)</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; then stop : = false;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if stop = false then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(1,23);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(4);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write(‘Ban muon chon quan 0 cot thu may ?&#039;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(1,24);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; read(i);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until i in cot;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(l,23);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(4);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writeln(‘Ban muon doi quan cua ban 0 cot, &#039;,i,&#039; sang hang nao ?&#039;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(l,24);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; read(j);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until j in &#91;1..n&#93;;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For k : = 1 to n do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if a&#91;i,k&#93;=nguoi then where 11: = k;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if a&#91;i,k&#93;=may then where2 : = k;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((wherel-where2)*(j-where2)&lt;=0) or (where1=j) then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error : = true;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write(‘Ban da di sai luat. An phim ENTER de di lai...&#039;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readln;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin a&#91;i,wherel&#93;: = 0;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&#91;i,j&#93; : = nguoi;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error : = false;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write(‘Ban da di dung luat. An phim ENTER de choi tiep...&#039;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readln;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; else</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(l,24);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(4);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writeln(‘Ban da thua !&#039;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write(‘An ENTER de thoat...&#039;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readln;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stop: = true;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">procedure doihe( byte var c: d);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">var p,tg,i: byte;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; p : = 0;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; fillchar(c,sizeof(c),0);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(p);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; c&#91;p&#93; : = x mod 2;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x : = x div 2;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until x=0;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">procedure congmang;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">var p: byte;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; fillchar(b,sizeof(b),0);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; for i : = 1 to n do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doihe(have&#91;i&#93;,suly&#91;i&#93;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for j : = 1 to 5 do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b&#91;j&#93;: = (b&#91;j&#93;+suly&#91;i&#93;&#91;j&#93;)mod 2;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">procedure maydi;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">var ch : char;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; draw;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; delay(random(500));</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; that : = 21;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; for i : = 1 to n do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; if i in cot then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; begin .</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for j : = 1 to n do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (a&#91;i,j&#93;=may) then where2 : = j;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (a&#91;i,j&#93;=nguoi)then where1: = j;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; have&#91;i&#93; : = abs(wherel-where2)-l;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (have&#91;i&#93;&lt; &gt;0) or ((where2-n)* (where2-1)&lt; &gt;0) then that : = i;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {dung cho khong tim ra duong di}</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; else</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; have&#91;i&#93; : = 0;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; congmang;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; i : = 6;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dec(i);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; until (i=0) or (b&#91;i&#93;=l);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; if b&#91;i&#93;=l then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j : = 0;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc(j);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until suly&#91;j&#93;&#91;i&#93;=l;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for k : = 1 to 5 do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if b&#91;k&#93;=1 then suly&#91;j&#93;&#91;k&#93;: = abs(1-suly&#91;j&#93;&#91;k&#93;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; that: = 0;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for 1: = 1 to 5 do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; that : = that+suly|j&#93;&#91;l&#93;*mu&#91;1-1&#93;;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for k : = 1 to n do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (a&#91;j,k&#93;=may) then where2 : = k;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (a&#91;j,k&#93;=nguoi) then where 1: = k;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">new1 : = where1+1+that;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">new2 : = where 1-1-that;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">if abs(new1-where2)&gt;abs(new2-where2) then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(1,24);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(4);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writeln(‘May se doi quan cua may o cot &#039; j,&#039; sang hang&#039;,new2);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;a&#91;j,where2&#93; : = 0;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&#91;j,new2&#93; : = may;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write(‘An phim ENTER de choi tiep...’);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readln;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;else</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(1,24);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(4);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writeln(’May se doi quan cua may o cot ’j,’ sang hang&#039;,new1);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&#91;j,where2&#93; : = 0;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&#91;j,new1&#93; : = may;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cireol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; write(An phim ENTER de choi tiep...&#039;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readln;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">else</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; if that &lt; &gt;21 then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for k : = 1 to n do</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (a&#91;that,k|=may) then where2 : = k;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (a&#91;that,k&#93;=nguoi) then where1 : = k;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new1 : = where2+1;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new2 : = where2-l;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((have&#91;that&#93;&gt;0) and (abs(new1-where2) &gt; abs(new2-where2))) or ((have&#91;tha=0) and (abs(newl=wherel) &lt; abs(new2-wherel))) then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(l,24)</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(4);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writeln(May se doi quan cua may o cot&#039;, that,&#039;sang hang&#039;,new2);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&#91;that,where2&#93;: = 0;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&#91;that,new2&#93;: = may;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write(‘An phim ENTER de choi tiep...’) readln;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(l,24);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(4);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writeln(May se doi quan cua may o cot&#039;, that,&#039;sang hang&#039;,new1);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&#91;that,where2&#93; : = 0;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a&#91;that,new&#93;: = may;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write(‘An phim ENTER de choi tiep...’);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readln;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gotoxy(1,24);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textcolor(4);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;writeln(‘Ban da thang !&#039;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clreol;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write(‘An phim ENTER de thoat...&#039;);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readln;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stop : = true;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clrscr;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;stop : = false;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; randomize;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; init;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if truoc then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nguoidi;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until error = false;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if sotp=false then maydi;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; begin</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; maydi;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if stop=false then</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; repeat</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nguoidi ;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until error = false;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; until stop;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; textbackground(0);</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clrscr;</span></span></span><br />
<span style="font-size:14pt"><span style="line-height:107%"><span style="font-family:&#039;Times New Roman&#039;,serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end.</span></span></span>
		</div>
	</div>
	<div id="footer" class="clearfix">
		<div id="url">
			<strong>URL của bản tin này: </strong><a href="https://sachgiai.com/savefile/Tin-hoc/lap-trinh-tro-choi-quan-co-trong-pascal-13465.html" title="Lập trình trò chơi quân cờ trong Pascal">https://sachgiai.com/savefile/Tin-hoc/lap-trinh-tro-choi-quan-co-trong-pascal-13465.html</a>

		</div>
		<div class="clear"></div>
		<div class="copyright">
			&copy; Sách Giải
		</div>
		<div id="contact">
			<a href="mailto:sachgiai2015@gmail.com">sachgiai2015@gmail.com</a>
		</div>
	</div>
</div>
        <div id="timeoutsess" class="chromeframe">
            Bạn đã không sử dụng Site, <a onclick="timeoutsesscancel();" href="https://sachgiai.com/#">Bấm vào đây để duy trì trạng thái đăng nhập</a>. Thời gian chờ: <span id="secField"> 60 </span> giây
        </div>
        <div id="openidResult" class="nv-alert" style="display:none"></div>
        <div id="openidBt" data-result="" data-redirect=""></div>
<script src="https://sachgiai.com/assets/js/jquery/jquery.min.js"></script>
<script>var nv_base_siteurl="/",nv_lang_data="vi",nv_lang_interface="vi",nv_name_variable="nv",nv_fc_variable="op",nv_lang_variable="language",nv_module_name="news",nv_func_name="savefile",nv_is_user=0, nv_my_ofs=-4,nv_my_abbr="EDT",nv_cookie_prefix="nv3c_Fsp0c",nv_check_pass_mstime=3538000,nv_area_admin=0,nv_safemode=0,theme_responsive=1,nv_recaptcha_ver=2,nv_recaptcha_sitekey="6LfJY60ZAAAAAIWdlphAn4Y3Vz9PjefcOrgz8WDV",nv_recaptcha_type="image",XSSsanitize=1;</script>
<script src="https://sachgiai.com/assets/js/language/vi.js"></script>
<script src="https://sachgiai.com/assets/js/DOMPurify/purify3.js"></script>
<script src="https://sachgiai.com/assets/js/global.js"></script>
<script src="https://sachgiai.com/assets/js/site.js"></script>
<script src="https://sachgiai.com/themes/whitebook/js/news.js"></script>
<script src="https://sachgiai.com/themes/whitebook/js/main.js"></script>
<script src="https://sachgiai.com/themes/whitebook/js/custom.js"></script>
<script type="application/ld+json">
        {
            "@context": "https://schema.org",
            "@type": "Organization",
            "url": "https://sachgiai.com",
            "logo": "https://sachgiai.com/uploads/sach-giai-com-logo.png"
        }
        </script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
			 (adsbygoogle = window.adsbygoogle || []).push({
				  google_ad_client: "ca-pub-7282572069040310",
				  enable_page_level_ads: true
			 });
        </script>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-PMHW5CD');</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1KVL9TDN71"></script>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag('js',new Date);gtag('config','G-1KVL9TDN71');</script>
<script src="https://sachgiai.com/themes/whitebook/js/bootstrap.min.js"></script>
</body>
</html>