float TBC(int a[],int n)
{int start,end,j,k,s,x,y,v;
int Sum=0;
int dem=0;
char T;
v=y-x;
ff:
printf("\nNhap diem bat dau = a[x]:\t");
for(int i=x-1;i<x+y;i++)
{
a[i]=a[i+1];
a[i+1]=x;
}
scanf("%d",&x);
printf("\nNhap diem ket thuc = a[y]:\t");
for(int i=x;i<n;i++)
{
a[i]=a[i+v];
a[i+v]=y;
}
scanf("%d",&y);
if(x<=0||y<=0||x>n||n<y||x+y>n||x>y){
printf("\n Dieu kien ban nhap sai.Tiep tuc C / k ?");fflush(stdin);T=getchar();
if(T=='c'||T=='C')goto ff;}
if(n>y){
k=n-y;
s=(n-k)-v;
for(int i=0;i<n;i++)
{
start=s;
end=n-k;
}}
else if(n==y){
k=n;s=k-v;
for(int i=0;i<n;i++){
start=s;end=k;
}}
else
{
k=y-n;
s=(n+k)-v;
for(int i=0;i<n;i++){
start=s;
end=n+k;}

}
for( j=start;j<end;j++)
{
Sum+=a[j];
dem++;
}
if(dem>0){
printf("\nSo dem duoc:%d.",dem);
printf("\nTong =%d.",Sum);
printf("\nTBC=%5.1f.",-1.0*(Sum/dem));}
else
printf("\nKhong co gia tri tra ve.\n");

}