<!DOCTYPE html>
    <html lang="vi" xmlns="http://www.w3.org/1999/xhtml" prefix="og: http://ogp.me/ns#">
    <head>
<title>Giải bài tập Tin học 11&#x3A; Bài tập và thực hành 5 - 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="Giải bài tập Tin học 11&#x3A; Bài tập và thực hành 5">
<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/giai-bai-tap-tin-hoc-11-bai-tap-va-thuc-hanh-5-10644.html">
<link rel="shortcut icon" href="https://sachgiai.com/favicon.ico">
<link rel="canonical" href="https://sachgiai.com/savefile/Tin-hoc/giai-bai-tap-tin-hoc-11-bai-tap-va-thuc-hanh-5-10644.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>Giải bài tập Tin học 11&#x3A; Bài tập và thực hành 5</h1>
		<ul class="list-inline">
			<li>Chủ nhật - 30/09/2018 03:54</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">
			Giải bài tập Tin học 11: Bài tập và thực hành 5
		</div>
		<div id="bodytext" class="clearfix">
			<strong>Bài 1. Nhập vào từ bàn phím một xâu. Kiểm tra xâu đó có phải là xâu đối xứng hay không. Xâu đôi xứng có tính chất đọc nó từ phải sang trái cũng như từ trái sang phải (còn được gọi là xâu palindrome).</strong><br  />Hãy chạy thử chương trình sau:<br  />var i, x: byte;<br  />a, p: string; begin<br  />write(&#039;Nhap vao xau: ’); readln(a);<br  />X:= length(a); {xac dinh do dai xau}<br  />p: = &#039; &#039;, {khoi tao xau rong} for i:= X downto 1 do<br  />p:= p+a[i]; {tao xau dao nguoc} if a= p then<br  />write(&#039;xau la palindrome&#039;) else<br  />write ( &#039;xau khong la palindrome&#039; ) ,<br  />readln<br  />end.<br  />Hãy viết lại chương trình trên, trong đó không cần cỏ biến xâu p.<br  /><u><em><strong>Giải:</strong></em></u><br  />a) Khi chạy chương trình, nhập vào xâu: &#039; vui ma hoc hoc ma vui&#039; thì chương trình đưa ra thông báo: &quot;xau khong la palindrome&quot;, còn khi nhập&nbsp; vào xâu &#039;abcddcba&#039; thì chương trình đưa ra thông báo: &quot;Xâu là palindroine?&quot;.<br  />Kết quả của chương trình cho như hình 52 dưới đây:<br  /><img alt="" height="124" src="https://sachgiai.com/uploads/news/2018_09/52.jpg" width="457" /><br  />b) Để viết lại chương trình dùng biến xâu thì ta cần khai thác khả năng tham chiếu đến từng kí tự trong xâu thông qua vị trí của xâu này. Như vậy, không cần thiết phải tạo một xâu mới để cuối cùng so sánh hai xâu, mà chỉ cần sánh cặp kí tự ở vị trí đối xứng nhau để kết luận có phải hay không.<br  />Bởi vậy, ta có thể dùng một biến logic để ghi nhận sự phát hiện này. Trước vòng lặp thực hiện các so sán nói trên, cần không chuyển biến logic ở mỗi bước lặp, hễ hai kí tự được so sánh khác nhau thì biến logic đó sẽ phải thay đổi giá trị.<br  />Chương trình sau đây dùng để kiểm tra xem xâu nhập vào có phải là xâu palindrome hay không.<br  />vai i, X: byte;<br  />a: string;<br  />palii: boolean;<br  />begin<br  />write (Nhap vao xau: ’ );<br  />reailn(a) ;<br  />X:= length(a); {xac dinh do dai cua xau}<br  />palin:=true;<br  />{khoi tao palin, tam coi xau a la palindrome}<br  />for i:= 1 to X div 2 do {so sanh cap ki tu doi xung}<br  />if a [i. ] oa [x-i + 1 ]<br  />then palin: =false;<br  />if palin then writeln: Xau la palindrome’)<br  />else writeln(’Xau khong la palindrome’);<br  />readln<br  />End.<br  />Khi chạy chương trình, nhập vào xâu: &#039;He 2007 &#039; thì chương trình đưa ra thông báo: &quot;xau khong la palindrome”, còn khi nhập vào xau &#039;abcđdcba&#039; thì chương trình đưa ra thông báo: &quot;xau la palindrome&quot; kết quả của chương trình cho như hình 53 dưới đây:<br  /><img alt="" height="104" src="https://sachgiai.com/uploads/news/2018_09/53.jpg" width="487" /><br  />Tuy nhiên, ta có thể không dùng vòng for-do mà dùng while-do hay repeat-until và có thể không cần dùng biến logic. Chương trinh sau đây đáp ứng được yêu cầu đặt ra:<br  />var x: byte;<br  />a: string;<br  />palin: boolean;<br  />begin<br  />write(&#039;Nhap vao xau: &#039; ) ,<br  />readln(a);<br  />X: =length (a) , {xac dinh do dai cua xa} i:=1;<br  />while (i&lt;=(x div 2)) and (a [i] =a [x-i + 1] ) do i: = i +1,ế if i&gt; (x div 2) then writeln(&#039;Xau la palindrome&#039;)<br  />else writeln(&#039;Xau khong la palindrome&#039;);<br  />readln<br  />End.<br  />Khi chạy chương trình, nhập vào xâu: &#039;tin hoc hoc tin&#039; thì chương trình đưa ra thông báo: &#039;xau khong la palindrome&quot;, còn khi nhập vào xâu &#039; ABCDDCBD&#039; thì chương trình cũng đưa ra thông báo: “xau khong la palindrome&quot;, còn khi nhập vào xâu: &#039; ABCD0770DCBA&#039; thì chương trình đưa ra thông báo: “xau la palindrome&quot; .<br  />Kết quả cùa chương trình cho như hình 55 dưới đây:<br  /><img alt="" height="171" src="https://sachgiai.com/uploads/news/2018_09/55.jpg" width="493" /><br  /><strong>Bài 2. Viết chương trình nhập từ bàn phím một xâu kí tự s và thông báo ra màn hình số lần xuất hiện của mỗi chữ cái tiếng Anh trong s (không phân biệt chữ hca hay chữ thường).</strong><br  /><strong><u><em>Giải:</em></u><br  />Để giải quyết bài toán này, chúng ta nhận thấy rằng:</strong><br  />Cần ghi nhận số lần xuất hiện của từng chữ cái. Có tất cả 26 chữ cái &#039; A &#039; &#039; z &#039;. Có thể dùng một mảng với chỉ số là kí tự từ &#039;A &#039; đến &#039;z&#039; để ghi nhận số lần xuất hiện của các kí tự trong xâu s. Bởi vậy, chúng ta dùng một mảng một chiều để đếm số lần xuất hiện của một kí tự trong xâu s. Cụ thể, để ghi nhận sổ lần xuất hiện của kí tự, ta có thể dùng dem[A] để ghi nhận sổ lần xuất hiện kí tự A (hay kí tự a, vì không phân biệt chữ hoa hay chữ thường).<br  />Để giải quyết vấn đề không phân biệt chữ hoa hay chữ thường ta cần dùng hàm Upcase(c).<br  />Do một kí tự xuất hiện trong xâu s có thể không phải là một chữ cái nên khi duyệt lần lượt từng kí tự trong xâu s, cần kiểm tra xem kí tự đó có phải là chữ cái hay không để ghi nhận số lần xuất hiện của nó. Chúng ta đã gặp đoạn chương trình kiểm tra một kí tự có là chữ số hay không ở ví dụ 5 tiết học 12. Từ đó, có thể viết được đoạn chương trinh làm việc duyệt từng phần tử cùa xâu và đếm.<br  />Dàn ý của chương trình:<br  />phần khai báo<br  />begin<br  />{nhập xâu S}<br  />N: = length (S);<br  />{Khởi tạo cho màng Dem}<br  />for i: =1 to N do {Neu s[i] là chữ cái thì đém tăng cho s[1]<br  />for c:=&#039;A&#039; to Z do {Thông báo sô lần xuất hiện của c}<br  />End.<br  />Chương trình nhập từ bàn phím một xâu kí tự và thông báo ra màn hình số lần xuất hiện của mỗi chữ cái tiếng Anh trong (không phân biệt chữ hoa hay chữ thường).<br  />Program tinh_ki_tu,<br  />var s,sl: string;<br  />i, j, n: integer;<br  />dem: array [ &#039;A’ . . &#039;z ’ ] of integer;<br  />c: char ;<br  />begin<br  />write(’Nhap vao xau: &#039;);<br  />readln(S);<br  />n:= length(s);<br  />for C:= &#039;A&#039; to &#039;Z&#039; do {khoi tao cho mang dem} dem[c]:= 0 ; s 1 : = ’ &#039; ;<br  />readln<br  />End.<br  />Khi nhập vào lần lượt các xâu: &#039;đfd&#039;2n5fv&#039; 3m.A&#039; , &#039; 55B7cfcManu07 &#039; , &#039; 8gs9&#039;0A6ha5kQ &#039; thì chương trình cho các kết quả như hình 56 dưới đây:<br  /><img alt="" height="293" src="https://sachgiai.com/uploads/news/2018_09/56.jpg" width="546" /><br  /><strong>Bài 3. Nhập vào từ bàn phím một xâu. Thay thế tất cả các cụm kí tự &quot;anh&quot; bằng cụm từ &#039;em&#039;.</strong><br  /><u><em><strong>Giải:</strong></em></u><br  />Đối với bài toán này:<br  />Để thay thế tất cả cụm từ &quot;anh&quot; trong một xâu st thành cụm kí tự &#039;em&#039;, có thể làm một cách tự nhiên: Tìm vị trí xâu con &#039;anh&#039;&nbsp; trong xâu st đã cho, xóa xâu con này đi rồi chèn xâu &quot;em&quot; vào vị trí đó. Lặp đi lặp lại điều này cho đến khi không tìm thấy xâu &quot;anh&#039; cần thay thế trong xâu st nữa. Đẻ giải quyết vấn đề này, chúng ta cần vận dụng các hàm Pos, thủ tục chuẩn Delete, Insert.<br  />Dàn ý chương trinh:<br  />{phần khai báo}<br  />Begin<br  />{Nhập xâu S}<br  />{Chừng nào còn tìm thấy xâu con ‘anh &#039; trong xâu st còn làm ba công việc sau: Tìm vị trí bắt đầu cùa xâu &#039;anh&#039; ;<br  />Xóa xâu &#039; anh&#039; vừa tìm thấy;<br  />Chèn xâu &#039; em&#039; vào xâu s tại vị trí trước đây xuất hiện xâu &#039;anh&#039; ;<br  />{In xau S kết quả}<br  />end.<br  /><br  />Chương trình nhập vào từ bàn phím một xâu, thay thế tất cả các cụm kí tự ‘anh ’ bằng cụm từ ‘em&#039;<br  />program thay_the_cum_tu;<br  />var vt: byte;<br  />St: string;<br  />Begin<br  />write(’Nhap vao mot xau: &#039;);<br  />readln(st);<br  />while pos (&#039;anh&#039;, st)&lt;&gt;0&nbsp;<br  />begin<br  />Vt : = pos ( &#039; anh &#039; , St. : ; delete(St,vt,3);<br  />insert(&#039;em&#039;,St,vt) ; end;<br  />write (&#039;Xau sau khi da duoc thay the: &#039; ,st ,&#039;)<br  />readln<br  />End.<br  /><br  /><em>Khi nhập vào lần lượt các xâu: &#039;anh&#039; và &#039;em&#039; ; &#039;anh em trong mot nha &#039; thì chương trình cho các kết quả theo thử tự như sau: &#039;em va em&#039; ,&#039; em em trong mot nha &#039; . Kết quả chương trình cho như hình 57 dưới đây:</em><br  /><img alt="" height="136" src="https://sachgiai.com/uploads/news/2018_09/57.jpg" width="538" />
		</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/giai-bai-tap-tin-hoc-11-bai-tap-va-thuc-hanh-5-10644.html" title="Giải bài tập Tin học 11&#x3A; Bài tập và thực hành 5">https://sachgiai.com/savefile/Tin-hoc/giai-bai-tap-tin-hoc-11-bai-tap-va-thuc-hanh-5-10644.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>