kiem tien, kiem tien online, kiem tien truc tuyen, kiem tien tren mang
Thursday, October 2, 2014

viết chương trình c kiểm tra mảng nhập vào đã được sắp xếp tăng dần hay chưa, in thông báo ra màn hình

#include<stdio.h>
#include<conio.h>
int a[100];
void main()
{
int i, n,k=0;
printf("nhap so phan tu cua mang: ");
scanf_s("%d", &n);
for (i = 0; i < n; i++)
{
printf("nhap phan tu thu %d: ",i+1);
scanf_s("%d", &a[i]);
}
for (i = 0; i < n - 1; i++) if (a[i]>a[i + 1]) k++;
if (k == 0) printf("mang da duoc sap xep tang dan");
else printf("mang chua duoc sap xep tang dan");
_getch();
}

02 Oct 2014

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

domain, domain name, premium domain name for sales

Popular Posts