<!DOCTYPE html>
    <html lang="vi" xmlns="http://www.w3.org/1999/xhtml" prefix="og: http://ogp.me/ns#">
    <head>
<title>Kiểu dữ liệu mảng &#40;array&#41; 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="Kiểu dữ liệu mảng &#40;array&#41; 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/kieu-du-lieu-mang-array-trong-pascal-13442.html">
<link rel="shortcut icon" href="https://sachgiai.com/favicon.ico">
<link rel="canonical" href="https://sachgiai.com/savefile/Tin-hoc/kieu-du-lieu-mang-array-trong-pascal-13442.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>Kiểu dữ liệu mảng &#40;array&#41; trong Pascal</h1>
		<ul class="list-inline">
			<li>Thứ năm - 30/07/2020 10:32</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">
			Một mảng dữ liệu gồm một số hữu hạn phần tử có cùng kiểu gọi là kiểu cơ bản. Số phần tử của mảng được xác định ngay từ khi định nghĩa ra mảng. Mỗi phần tử của mảng được truy nhập trực tiếp thông qua tên mảng cùng với chỉ dẫn truy nhập được để giữa hai ngoặc vuông &#91; &#93;.
		</div>
		<div id="bodytext" class="clearfix">
			<b>1. KHÁI NIỆM</b><br />
Chúng ta đã làm quen với các kiểu dữ liệu đơn giản là các kiểu vô hướng (integer, char, boolean, real, kiểu liệt kê) và đoạn con. Trong Pascal tồn tại các kiểu dữ liệu có cấu trúc là các kiểu dữ liệu được tạo ra tư các phần tử có kiểu dữ liệu đơn giản bằng một cách nào đó. Chúng được đặc trưng bằng kiểu dữ liệu của các phần tử và điều quan trọng hơn cả là phương pháp cấu thành dữ liệu mới (điều đó cũng có nghĩa là phương pháp truy nhập vào kiểu dữ liệu có cấu trúc). Tính có cấu trúc của dữ liệu là một đặc trưng của ngôn ngữ lập trình có cấu trúc.<br />
Pascal có tất cả 4 kiểu dữ liệu có cấu trúc mà chúng ta sẽ lần lượt nghiên cứu: mảng (ARRAY), tập (SET), bản ghi (RECORD) và tệp (FILE).<br />
<br />
<b>2. ĐỊNH NGHĨA: KIỂU DỮ LIỆU MẢNG (ARRAY)</b><br />
Một mảng dữ liệu gồm một số hữu hạn phần tử có cùng kiểu gọi là kiểu cơ bản. Số phần tử của mảng được xác định ngay từ khi định nghĩa ra mảng. Mỗi phần tử của mảng được truy nhập trực tiếp thông qua tên mảng cùng với chỉ dẫn truy nhập được để giữa hai ngoặc vuông &#91; &#93;. Ví dụ: A&#91;5&#93; là phần tử thứ 5 của mảng A.<br />
Định nghĩa kiểu mảng T có kiểu của các phần tử KPT, có kiểu chỉ dẫn KCD để hướng dẫn cách tổ chức mảng cũng như cách truy nhập vào các phần tử mảng được viết trong Pascal như sau:<br />
TYPE<br />
&nbsp;&nbsp;&nbsp;&nbsp; T = ARRAY&#91;KCD&#93; OF KPT<br />
Khi đó việc khai báo một biến A có kiểu là T có thể được viết như sau:<br />
VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp; A: T ;<br />
Hoặc ta có thể khai báo trực tiếp biến A cùng với kiểu cùng mảng trong phần khai báo biến khi không có định nghĩa trong phần TYPE:<br />
&nbsp;&nbsp;&nbsp;&nbsp; VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A = ARRAY &#91;Kiểu_chỉ_dẫn&#93; of kiểu_phần_tử.<br />
Chúng ta hãy xét một số ví dụ định nghĩa và khai báo sau:<br />
<br />
■ Ví dụ 1:<br />
&nbsp; TYPE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;MAININT = ARRAY &#91;1..20&#93; OF INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;MANGCHAR = ARRAY &#91;1..20&#93; OF CHAR ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;THU = (CHUNHAT, HAI, BA, TƯ, NAM, SAƯ, BAY) ;<br />
&nbsp;&nbsp; VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MI, MJ, MK: MANGINT ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X, Y: MANGCHAR ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ml, M2: ARRAY &#91;-10.. 10&#93; OF REAL ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; M3: ARRAY &#91;&#039;A&#039;..&#039;Z&#039;&#93; OF INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TUAN: ARRAY &#91;THU&#93; OF BOOLEAN ;<br />
MANGINT và MANGCHAR là hai kiểu mảng gồm 20 phần tử được đánh số thứ tự từ 1 đến 20 thông qua kiểu chỉ dẫn là một đoạn con các số nguyên 1..20. Các phần tử MANGINT có kiểu là số nguyên, còn các phần tử của MANGCHAR có kiểu là các kí tự, MI, MJ, MK là các biến có kiểu là MANGINT.<br />
Còn M1 và M2 là hai biến được định nghĩa kiểu luôn khi khai báo. Đây là hai biến mảng gồm 21 phần tử là các số nguyên, được đánh số từ -10 đến 10.<br />
M3 là một biến mảng gồm 26 số nguyên đánh số qua các chỉ dẫn là các chữ cái từ &#039;A&#039; cho đến ‘Z’.<br />
TUAN là một mảng gồm 7 phần tử kiểu Boolean, các phần tử được đánh dấu qua chỉ dẫn là tên của 7 ngày trong tuần.<br />
Một điều lưu ý là khi khai báo mảng, kiểu chỉ dẫn chỉ có thể là các kiểu đơn giản: kiểu đoạn con của các loại dữ liệu vô hướng đếm được như kí tự (như biến M3), số nguyên (thí dụ đoạn con integer như các kiểu MANGINT, MANGCHAR). Kiểu Boolean. Kiểu chỉ dẫn không được là kiểu không đếm được như REAL. Nghĩa là không được viết:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X: ARRAY &#91;REAL&#93; OF INTEGER ;<br />
Ngoài ra, do giới hạn của vùng nhớ dành cho dữ liệu, số lượng phần từ của một mảng cũng bị hạn chế tùy thuộc vào kích thước của kiểu dữ liệu của các phần tử. Vì lí do này ta không thể khai báo mảng dạng:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X: ARRAY &#91;INTEGER&#93; OF INTEGER ;<br />
dù INTEGER là kiêu vó hướng đếm được. Nhưng ta có thế khai báo như sau:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X: ARRAY &#91;BYTE&#93; OF INTEGER ;<br />
Việc truy nhập vào một phần tử nào đó của mảng được thực hiện qua tên biến mảng, theo sau là giá trị chỉ dẫn để trong ngoặc vuông như:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TUAN&#91;HAI&#93;:= TRUE ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; M3&#91;&#039;X&#039;|:= 5 ;<br />
Do thời gian truy nhập vào một phần tử của mảng không phụ thuộc vào giá trị của chỉ dẫn riêng nên câu trúc mảng thuộc kiểu cấu trúc truy nhập trực tiếp.<br />
PASCAL không cho phép chúng ta nhập dữ liệu trực tiếp vào một mảng mà phải nhập giá trị của từng phần tử của từng mảng.<br />
<br />
■ Ví dụ 2:<br />
Để nhập dữ liệu vào mảng M1 ta phải viết như sau:<br />
Writeln (’Nhập số liệu:’) ;<br />
For I:= -10 to 10 do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write (&#039;Ml&#91;&#039;, I,’&#93; =&#039;) ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Readln (M1&#91;I&#93;) ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End ;<br />
Trong ví dụ này ta cần thêm một biến i có kiểu là INTEGER làm biến chỉ dẫn.<br />
<br />
<b>3. THAO TÁC TRÊN MẢNG</b><br />
Khác với các kiểu dữ liệu định- sẵn, trên kiểu dữ liệu mảng các thao tác đều do người lập trình tự xây dựng dựa trên các thao tác sẵn có trên các phần tử của mảng. PASCAL chỉ cho phép chúng ta gán giá trị của một biến mảng này cho một biến mảng khác có cùng kiểu:<br />
&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MI:= KJ ;<br />
trong đó MI, MJ là hai mảng khai báo trong ví dụ 1 ở trên.<br />
<br />
<b>■ Ví dụ 3:</b><br />
Để có thể xây dựng phép cộng 2 mảng cùng kiểu ta làm như sau:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For I:= 1 to 20 do MK&#91;I&#93;:= MI&#91;I&#93; + MJ&#91;I&#93; ;<br />
<br />
<b>■ Ví dụ 4:</b><br />
Để tìm kiếm phần tử lớn nhất trong một mảng A các số nguyên ta làm như sau:<br />
&nbsp;&nbsp;&nbsp;&nbsp; CONST<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SPT =10;<br />
&nbsp;&nbsp;&nbsp;&nbsp; TYPE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MA = ARRAY &#91;1..SPT&#93; OF INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp; VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PTMAX: INTEGER ; {Dùng để lưu giá trị lớn nhất trong A}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: MA ;<br />
&nbsp;&nbsp;&nbsp;&nbsp; FUNCTION MAX (A: MA ; N: INTEGER): INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp; (hàm MAX trả về giá trị của pt lớn nhất trong A}<br />
&nbsp;&nbsp;&nbsp;&nbsp; VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; M, I: INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp; BEGIN<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;M:= A&#91;l&#93; (Giả sử {1} là MAXI<br />
&nbsp;&nbsp;&nbsp;&nbsp; FOR I:= 2 TO N DO<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF A&#91;I&#93; &gt; M THEN M:= A&#91;I&#93; ;<br />
&nbsp;&nbsp;&nbsp;&nbsp; END ;<br />
&nbsp;&nbsp;&nbsp;&nbsp; BEGIN<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... {nhập số liệu của mảng A}<br />
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PTMAX:= MAX(A. SPT) ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; …<br />
&nbsp;&nbsp;&nbsp; END<br />
<br />
<b>■ Ví dụ 5:</b><br />
Để tìm kiếm phần tử X trong một mảng A các số nguyên ta làm như sau:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONST<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SPT = 10 ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MA = ARRAY &#91;1..SPT&#93; OF INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VT_X, S: INTEGER ; {Dùng để lưu giá trị lớn nhất trong. A}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: MA ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FUNCTION TIM_X (X: INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: MA. N &gt; INTEGER): INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {Hàm TIM_X trả về vị trí của X trong A nếu TIM_X &lt;&gt; 0.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Nếu TIM_X = 0, &lt; không nằm trong A},<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; M, I: INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BEGIN<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; M:= 0 ; {Giả sử A&#91;l&#93; là MAX)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I:= 1 ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; While (I &lt;= N) AND (m = 0) do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF ATI&#93; = X THEN M:= I ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TIM_X:= M ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BEGIN<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... {Nhập sô&#039; liệu của mảng A}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VT-X:= TIM_X (X, A, SPT) ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END.<br />
&nbsp;<br />
Tổng quát, để tìm phần tử X thỏa mãn điều kiện trong mảng A ta có thể làm như sau:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONST<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SPT = 10 ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MA = ARRAY &#91;1..SPT&#93; OF INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VT_X, X: INTEGER ; {Dùng để lưu giá trị lớn nhất trong A}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A: MA ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FUNCTION TIM_THEO_DK (VAR X: INTEGER ; A: MA;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N: INTEGER): INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {Tham số X trả về giá trị của Phần tử thỏa điêu kiện}.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hàm TIM_X trả về giá trị của Phần tử thỏa điều kiện,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hàm TIMLX trả về vị trí của X trong A nếu TIM_X &lt;&gt; 0.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Nếu TIM_X = 0, X không nằm trong A}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; M, I: INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BEGIN<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; M:= 0 {Giả sử A&#91;l&#93; là MAX}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I:= 1 ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHILE (I &lt;= N) ANMD (M = 0) DO<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Đieu_kien = TRUE THEN<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Begin<br />
&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; M:= I ;<br />
&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; X:= A&#91;I&#93; ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TIM_X:= M ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BEGIN<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... {Nhập số liệu của mảng A}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VT_X:= TIM_X (X, A, SPT);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END.<br />
&nbsp;<br />
<b>4. MẢNG NHIỀU CHIỀU</b><br />
Kiểu phần tử của mảng không bị hạn chế nhiều như kiểu chỉ dẫn. Nó còn có thể là các kiểu cấu trúc. Ví dụ sau cho thấy việc khai báo một mảng có các phần tử cũng là mảng.<br />
<br />
<b>■ Ví dụ 6:</b><br />
&nbsp;&nbsp;&nbsp;&nbsp; TYPE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PT = ARRAY fl..51 OF REAL ; {Pt: Kiểu phần tử}<br />
&nbsp;&nbsp;&nbsp;&nbsp; VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MPT: ARRAY &#91;1 .31 OF PT ; {MPT: Mang phần tử}<br />
Hoặc viết một lần như sau:<br />
&nbsp;&nbsp;&nbsp;&nbsp; VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MPT: ARRAY II..31 OF ARRAY &#91;1..5&#93; OF REAL<br />
Hoặc thường được viết gọn lại:<br />
&nbsp;&nbsp;&nbsp;&nbsp; VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MPT: ARRAY &#91;1 .3, 1..5&#93; OF REAL ;<br />
MPT được định nghĩa như trên chính là ma trận 2 chiều 3 hàng và 5 cột.<br />
Việc truy nhập đôi với màng ó định nghĩa phức tạp như MPT được tiến hành qua hai cách:<br />
+ Qua hai lần đóng mở ngoặc vuông. Thí dụ MPT&#91;3&#93;&#91;5&#93; biểu diễn phần tử cuối cùng của mảng MPT.<br />
+ Hoặc thường được viết đơn giản trong một ngoặc vuông với các chỉ dẫn cách nhau bằng dấu phẩy: MPT&#91;3, 5&#93; ;<br />
Cách viết MPT&#91;I&#93;&#91;J&#93; và MPT&#91;I,J&#93; là tương đương nhau. Mảng được định nghĩa như trên có thể hiểu là ma trận nhiều chiều. Phần tử MPT&#91;I,J&#93; sẽ là phần tử hàng I, cột thứ J của MPT.<br />
<br />
<b>■ Ví dụ 7:</b><br />
Chương trình nhân hai ma trận vuông cấp N: C = A * B<br />
Phần tử của ma trận tích được tính theo công thức:<br />
<i>C</i><i>ij</i><i>=</i><i>a</i><i>k=1</i><i>&nbsp;&nbsp;&nbsp; N</i><i>&nbsp;&nbsp; 0</i><img alt="" height="50" src="https://sachgiai.com/uploads/news/2020_07/image-20200730213214-1.png" width="68" /> a<sub>ik</sub>bkj<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp; PROGRAM NHAN_MA_TRAN ;<br />
&nbsp;&nbsp;&nbsp;&nbsp; CONST<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N = 5 ;<br />
&nbsp;&nbsp;&nbsp;&nbsp; TYPE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MATRAN = ARRAY &#91;1..N, 1..N&#93; OF INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp; VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A, B, C: MATRAN ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I, J, K: INTEGER ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PROCEDURE TICH-MT (A,B: MATRAN: Var C: MATRAN;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N: INTEGER) ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {Nhân 2 ma trận vuông cấp N: C = A*B}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FOR I:= 1 TO N DO<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C&#91;I,J&#93;:= 0 ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FOR K:= 1 TO N DO<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C&#91;I,J&#93;:= C&#91;I,J&#93; + A&#91;I,K&#93; *B&#91;K, J&#93;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End;<br />
&nbsp;&nbsp;&nbsp;&nbsp; BEGIN<br />
&nbsp;&nbsp;&nbsp;&nbsp; {Đọc vào giá trị của ma trận A}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Writeln (’Nhập ma trận A:’)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FOR I:= 1 TO N DO<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write (A&#91;&#039;,I’,J,’&#93; =’) ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Readln (A&#91;I, J&#93;) ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End; ,<br />
&nbsp;&nbsp;&nbsp; {Đọc vào giá trị của ma trận B}<br />
&nbsp;&nbsp;&nbsp; Writeln (’Nhập ma trận B:’) ;<br />
&nbsp;&nbsp;&nbsp;&nbsp; FOR J:=1TO N DO<br />
&nbsp;&nbsp;&nbsp;&nbsp; FOR J:= 1 TO N DO<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write (‘B&#91;’,I’;’J,&#039;&#93; =’) ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Readln (B&#91;I,J|) ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End ;<br />
&nbsp; TICH_MT (A, B, C, N) ;<br />
&nbsp; Writeln (&#039;Tích của hai ma trận =&#039;) ;<br />
&nbsp; FOR I:= 1 TO N DO<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FOR J:= 1 TO N DO Write (C&#91;I,J1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Writein ;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End ;<br />
&nbsp;&nbsp; END.<br />
Mảng có thể dùng làm tham số cho chương trình con và mảng không bao giờ dùng làm kết quả của FUNCTION. Tuy nhiên cần khai báo kiểu của tham số trong vùng khai báo TYPE chứ không định nghĩa kiểu trực tiếp ngay trong phần khai tham số của CTC (xem thí dụ khai báo kiểu MT dưới đây).<br />
<br />
<b>■ Ví dụ 8:</b><br />
Cộng hai ma trận C = A + B<br />
PROGRAM CONG_MA_TRAN ;<br />
&nbsp;&nbsp;&nbsp;&nbsp; CONST<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N = 5 ;<br />
TYPE MATRAN = ARRAY &#91;1..N, 1..N&#93; OF REAL ;<br />
VAR<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X, Y, Z, MT ;<br />
{………………………………………………………}<br />
PROCEDURE CONG_MATRAN (A,B: MATRAN ; VAR C: MATRAN);<br />
Var<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I, J: INTEGER ;<br />
Begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FOR I:= 1 TO N DO<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FOR J:= 1 TO N DO<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C&#91;I,J&#93;:= A&#91;I,J&#93; + B&#91;I,J&#93; ;<br />
End ;<br />
{………………………………………………………}<br />
BEGIN<br />
…<br />
CONG_MATRAN(X, Y, X) ;<br />
…<br />
END.
		</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/kieu-du-lieu-mang-array-trong-pascal-13442.html" title="Kiểu dữ liệu mảng &#40;array&#41; trong Pascal">https://sachgiai.com/savefile/Tin-hoc/kieu-du-lieu-mang-array-trong-pascal-13442.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>