SlideShare a Scribd company logo
1 of 1
include <stdio.h>
#include <conio.h>
void main()
{
  int a[100],i,n,kt;

    printf("Nhap so phan tu:");
    scanf("%d",&n);
    for (i=0;i<n;i++)
     {
       printf("nNhap a[%d]=",i);
       scanf("%d",&a[i]);
     }
    printf("n");
    for (i=0;i<n;i++) printf("%d ",a[i]);

    // Kiem tra doi xung.
    kt=1;
    for (i=0;i<=(n-2)/2;i++)
       if (a[i]!=a[n-1-i])
        {
            kt=0; break;
        }
      if (kt) printf("nDay doi xung."); else printf("nDay ko doi xung.");
    getch();

}

More Related Content

What's hot (18)

Sources
SourcesSources
Sources
 
B.f.s
B.f.sB.f.s
B.f.s
 
Quick sort
Quick sortQuick sort
Quick sort
 
Cpro
CproCpro
Cpro
 
Programas for
Programas forProgramas for
Programas for
 
Fcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt ChartFcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt Chart
 
listing output program C
listing output program Clisting output program C
listing output program C
 
[程式設計]標準差
[程式設計]標準差[程式設計]標準差
[程式設計]標準差
 
Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2
 
C - Pattern - Code - [Future Programming]
C - Pattern - Code - [Future Programming]C - Pattern - Code - [Future Programming]
C - Pattern - Code - [Future Programming]
 
Dij
DijDij
Dij
 
Ooprc3b
Ooprc3bOoprc3b
Ooprc3b
 
Union
UnionUnion
Union
 
C language program
C language programC language program
C language program
 
07 3 do-while반복문
07 3 do-while반복문07 3 do-while반복문
07 3 do-while반복문
 
12 2 문자열 응용
12 2 문자열 응용12 2 문자열 응용
12 2 문자열 응용
 
bai tap-loi-giai-ngon-ngu-lap-trinh-c
 bai tap-loi-giai-ngon-ngu-lap-trinh-c bai tap-loi-giai-ngon-ngu-lap-trinh-c
bai tap-loi-giai-ngon-ngu-lap-trinh-c
 
Numeros primos
Numeros primosNumeros primos
Numeros primos
 

Viewers also liked

PHÉP ĐỐI XỨNG TRỤC VÀ ĐỐI XỨNG TÂM
PHÉP ĐỐI XỨNG TRỤC VÀ ĐỐI XỨNG TÂMPHÉP ĐỐI XỨNG TRỤC VÀ ĐỐI XỨNG TÂM
PHÉP ĐỐI XỨNG TRỤC VÀ ĐỐI XỨNG TÂMDANAMATH
 
список членов лаборатории
список членов лаборатории список членов лаборатории
список членов лаборатории channa1971
 
Botswana's Integration of Data Quality Assurance into Standard Operating Proc...
Botswana's Integration of Data Quality Assurance into Standard Operating Proc...Botswana's Integration of Data Quality Assurance into Standard Operating Proc...
Botswana's Integration of Data Quality Assurance into Standard Operating Proc...MEASURE Evaluation
 
SRP 2014 - CAR
SRP 2014 - CARSRP 2014 - CAR
SRP 2014 - CARCarnegieNL
 
The photgraphic elephant
The photgraphic elephantThe photgraphic elephant
The photgraphic elephantPAC Apellidos
 
Borang kosong pembinaan isi cerita mtq
Borang kosong pembinaan isi cerita mtqBorang kosong pembinaan isi cerita mtq
Borang kosong pembinaan isi cerita mtqKamarudin Jaafar
 
Power point
Power pointPower point
Power pointjehimi
 
houtkooltekeningen buiten
houtkooltekeningen buitenhoutkooltekeningen buiten
houtkooltekeningen buitenLinda Overgoor
 
8 borang catatan masa mtqss 2014 (1)
8 borang catatan masa mtqss 2014 (1)8 borang catatan masa mtqss 2014 (1)
8 borang catatan masa mtqss 2014 (1)Kamarudin Jaafar
 

Viewers also liked (13)

PHÉP ĐỐI XỨNG TRỤC VÀ ĐỐI XỨNG TÂM
PHÉP ĐỐI XỨNG TRỤC VÀ ĐỐI XỨNG TÂMPHÉP ĐỐI XỨNG TRỤC VÀ ĐỐI XỨNG TÂM
PHÉP ĐỐI XỨNG TRỤC VÀ ĐỐI XỨNG TÂM
 
Gerencia de proyectos
Gerencia de proyectosGerencia de proyectos
Gerencia de proyectos
 
список членов лаборатории
список членов лаборатории список членов лаборатории
список членов лаборатории
 
Botswana's Integration of Data Quality Assurance into Standard Operating Proc...
Botswana's Integration of Data Quality Assurance into Standard Operating Proc...Botswana's Integration of Data Quality Assurance into Standard Operating Proc...
Botswana's Integration of Data Quality Assurance into Standard Operating Proc...
 
SRP 2014 - CAR
SRP 2014 - CARSRP 2014 - CAR
SRP 2014 - CAR
 
The photgraphic elephant
The photgraphic elephantThe photgraphic elephant
The photgraphic elephant
 
María inmaculada, madre que cree.
María inmaculada, madre que cree.María inmaculada, madre que cree.
María inmaculada, madre que cree.
 
Practica sabadomañana
Practica sabadomañanaPractica sabadomañana
Practica sabadomañana
 
Borang kosong pembinaan isi cerita mtq
Borang kosong pembinaan isi cerita mtqBorang kosong pembinaan isi cerita mtq
Borang kosong pembinaan isi cerita mtq
 
Power point
Power pointPower point
Power point
 
Lizz
LizzLizz
Lizz
 
houtkooltekeningen buiten
houtkooltekeningen buitenhoutkooltekeningen buiten
houtkooltekeningen buiten
 
8 borang catatan masa mtqss 2014 (1)
8 borang catatan masa mtqss 2014 (1)8 borang catatan masa mtqss 2014 (1)
8 borang catatan masa mtqss 2014 (1)
 

More from Nguyen Van Hung

Cai dat va_cau_hinh_iptables
Cai dat va_cau_hinh_iptablesCai dat va_cau_hinh_iptables
Cai dat va_cau_hinh_iptablesNguyen Van Hung
 
So sánh asp.net và mvc
So sánh asp.net và mvcSo sánh asp.net và mvc
So sánh asp.net và mvcNguyen Van Hung
 
Cong thuc sinh hoc 12 day du nhat
Cong thuc sinh hoc 12 day du nhatCong thuc sinh hoc 12 day du nhat
Cong thuc sinh hoc 12 day du nhatNguyen Van Hung
 
Cong thuc sinh hoc 12 day du nhat
Cong thuc sinh hoc 12 day du nhatCong thuc sinh hoc 12 day du nhat
Cong thuc sinh hoc 12 day du nhatNguyen Van Hung
 
Asp net mvc3 music store egroups vn
Asp net mvc3 music store   egroups vnAsp net mvc3 music store   egroups vn
Asp net mvc3 music store egroups vnNguyen Van Hung
 
Asp.net mvc 3 (c#) (9 tutorials) egroups vn
Asp.net mvc 3 (c#) (9 tutorials)   egroups vnAsp.net mvc 3 (c#) (9 tutorials)   egroups vn
Asp.net mvc 3 (c#) (9 tutorials) egroups vnNguyen Van Hung
 
Cau truc dl_va_giai_thuat_bai1[1] - copy
Cau truc dl_va_giai_thuat_bai1[1] - copyCau truc dl_va_giai_thuat_bai1[1] - copy
Cau truc dl_va_giai_thuat_bai1[1] - copyNguyen Van Hung
 
Thạch quyển và các dạng địa hình
Thạch quyển và các dạng địa hìnhThạch quyển và các dạng địa hình
Thạch quyển và các dạng địa hìnhNguyen Van Hung
 
Bài tập về chuẩn hóa chuỗ1
Bài tập về chuẩn hóa chuỗ1Bài tập về chuẩn hóa chuỗ1
Bài tập về chuẩn hóa chuỗ1Nguyen Van Hung
 
Khoahoctunhien.net mang1chieu
Khoahoctunhien.net mang1chieuKhoahoctunhien.net mang1chieu
Khoahoctunhien.net mang1chieuNguyen Van Hung
 
De cuong tu tuong hcm khoa iv
De cuong tu tuong hcm  khoa ivDe cuong tu tuong hcm  khoa iv
De cuong tu tuong hcm khoa ivNguyen Van Hung
 

More from Nguyen Van Hung (18)

Su dung linux shell
Su dung linux shellSu dung linux shell
Su dung linux shell
 
Cai dat va_cau_hinh_iptables
Cai dat va_cau_hinh_iptablesCai dat va_cau_hinh_iptables
Cai dat va_cau_hinh_iptables
 
Git slides
Git slidesGit slides
Git slides
 
390a gitintro 12au
390a gitintro 12au390a gitintro 12au
390a gitintro 12au
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
So sánh asp.net và mvc
So sánh asp.net và mvcSo sánh asp.net và mvc
So sánh asp.net và mvc
 
Cong thuc sinh hoc 12 day du nhat
Cong thuc sinh hoc 12 day du nhatCong thuc sinh hoc 12 day du nhat
Cong thuc sinh hoc 12 day du nhat
 
Cong thuc sinh hoc 12 day du nhat
Cong thuc sinh hoc 12 day du nhatCong thuc sinh hoc 12 day du nhat
Cong thuc sinh hoc 12 day du nhat
 
Asp net mvc3 music store egroups vn
Asp net mvc3 music store   egroups vnAsp net mvc3 music store   egroups vn
Asp net mvc3 music store egroups vn
 
Asp.net mvc 3 (c#) (9 tutorials) egroups vn
Asp.net mvc 3 (c#) (9 tutorials)   egroups vnAsp.net mvc 3 (c#) (9 tutorials)   egroups vn
Asp.net mvc 3 (c#) (9 tutorials) egroups vn
 
Northwind products
Northwind productsNorthwind products
Northwind products
 
Cau truc dl_va_giai_thuat_bai1[1] - copy
Cau truc dl_va_giai_thuat_bai1[1] - copyCau truc dl_va_giai_thuat_bai1[1] - copy
Cau truc dl_va_giai_thuat_bai1[1] - copy
 
Bao cao
Bao caoBao cao
Bao cao
 
Thạch quyển và các dạng địa hình
Thạch quyển và các dạng địa hìnhThạch quyển và các dạng địa hình
Thạch quyển và các dạng địa hình
 
Bài tập về chuẩn hóa chuỗ1
Bài tập về chuẩn hóa chuỗ1Bài tập về chuẩn hóa chuỗ1
Bài tập về chuẩn hóa chuỗ1
 
Khoahoctunhien.net mang1chieu
Khoahoctunhien.net mang1chieuKhoahoctunhien.net mang1chieu
Khoahoctunhien.net mang1chieu
 
Gtrinh oop[1]
Gtrinh oop[1]Gtrinh oop[1]
Gtrinh oop[1]
 
De cuong tu tuong hcm khoa iv
De cuong tu tuong hcm  khoa ivDe cuong tu tuong hcm  khoa iv
De cuong tu tuong hcm khoa iv
 

Recently uploaded

مختصر علم احكام القرآن فقه القرآن وفق منهج العرض
مختصر علم احكام القرآن فقه القرآن وفق منهج العرضمختصر علم احكام القرآن فقه القرآن وفق منهج العرض
مختصر علم احكام القرآن فقه القرآن وفق منهج العرضأنور غني الموسوي
 
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...Nguyen Thanh Tu Collection
 
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...Nguyen Thanh Tu Collection
 
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaranFAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaransekolah233
 

Recently uploaded (6)

Energy drink .
Energy drink                           .Energy drink                           .
Energy drink .
 
مختصر علم احكام القرآن فقه القرآن وفق منهج العرض
مختصر علم احكام القرآن فقه القرآن وفق منهج العرضمختصر علم احكام القرآن فقه القرآن وفق منهج العرض
مختصر علم احكام القرآن فقه القرآن وفق منهج العرض
 
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
 
LAR MARIA MÃE DE ÁFRICA .
LAR MARIA MÃE DE ÁFRICA                 .LAR MARIA MÃE DE ÁFRICA                 .
LAR MARIA MÃE DE ÁFRICA .
 
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
 
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaranFAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
 

Doi xung mang mot chieu

  • 1. include <stdio.h> #include <conio.h> void main() { int a[100],i,n,kt; printf("Nhap so phan tu:"); scanf("%d",&n); for (i=0;i<n;i++) { printf("nNhap a[%d]=",i); scanf("%d",&a[i]); } printf("n"); for (i=0;i<n;i++) printf("%d ",a[i]); // Kiem tra doi xung. kt=1; for (i=0;i<=(n-2)/2;i++) if (a[i]!=a[n-1-i]) { kt=0; break; } if (kt) printf("nDay doi xung."); else printf("nDay ko doi xung."); getch(); }