#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <math.h>
#include <string.h>
#include <time.h>
void NhapMang(int a[],int &n)
{
printf("Nhap vao so luong bien cua a: ");
scanf("%d",&n);
for(int i = 0; i < n; i++)
{
printf("\nNhap vao a[%d] = ",i);
scanf("%d", &a[i]);
}
}
void XuatMang(int a[],int n)
{
for(int i = 0; i < n; i++)
{
printf("%4d",a[i]);
}
}
void BubbleSort(int a[], int n)
{
}
void SelectionSort(int a[], int n)
{
}
void InsertionSort(int a[], int n)
{
}
int main()
{
int m,chon;
do
{
int a[10],n;
printf("\n1.Nhap mang\n");
printf("2.Xuat mang\n");
printf("3.Bubblesort\n");
printf("0.Ket thuc\n");
printf("Nhap vao muc muon chon: ");
scanf("%d",&chon);
switch(chon)
{
case 1:
{
NhapMang(a,n);
break;
}
case 2:
{
XuatMang(a,n);
break;
}
case 3:
{
BubbleSort(a,n);
break;
}
}
getch();
system("cls");
}while(chon!=0);
}



Bình luận