noj一道冒泡排序,不能通过,求大神解答

题目描述
给定输入排序元素数目n和相应的n个元素,写出程序,利用内排序算法中冒泡排序算法进行排序,并输出排序过程中每趟及最后结果的相应序列。

输入

共两行,第一行给出排序元素数目n,第二行给出n个元素,1≤n≤400,每个元素值范围为 [0,100000)

输出

三个部分
第1部分为两行,第1行输出文字“Source:”,第2行给出原始序列;
第2部分,开始输出文字“Bubble Sort:”,后续输出简单选择排序过程;
第3部分,开始输出文字“Result”,后续输出排序结果。
样例输入

 7
48 36 68 72 12 48 2

样例输出

 Source:
(48 36 68 72 12 48 2)
Bubble Sort:
(36 48 68 12 48 2) 72
(36 48 12 48 2) 68 72
(36 12 48 2) 48 68 72
(12 36 2) 48 48 68 72
(12 2) 36 48 48 68 72
(2) 12 36 48 48 68 72
Result
(2 12 36 48 48 68 72)

 #include<stdio.h>
#define N 400

void init(int a[],int n)
{   int i;
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }

}
void bubberSort(int a[],int n)
{
    int i,j,t,k=1;
    for(i=0;i<n-1;i++)
    {
        for(j=0;j<n-1-i;j++)
        {
            if(a[j]>a[j+1])
            {
                t=a[j+1];
                a[j+1]=a[j];
                a[j]=t;
            }
        }
        putchar('(');
        for(j=0;j<n;j++)
        {
            if(j==0)
            {
              if(i!=n-1-1)
              printf("%d",a[j]);
              else printf("%d)",a[j]);   
            }
            else if(j==n-1-k)
            {
                printf("%c%d",32,a[j]);
                putchar(')');
            }
            else printf("%c%d",32,a[j]);

        }
          k++;
            putchar('\n');
    }

 }
void myPrint(int a[],int n)
{
    int i;
    putchar('(');
    for(i=0;i<n;i++)
    {
         if(i==n-1)
        {
            printf("%d",a[i]);
            putchar(')');
        }
        else printf("%d%c",a[i],32);

    }
    printf("\n");
}  
int main()
{
    int a[N],n;
    scanf("%d",&n);
    init(a,n);
    puts("Source: ");
    myPrint(a,n);
    puts("BubbleSort: ");
    bubberSort(a,n);
    puts("Result: ");
    myPrint(a,n);
    return 0;     
    getchar(); 
 }



显示答案错误
我的代码怎么修改才能通过啊
原题链接http://acm.njupt.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=1063

题目说是Bubble Sort,但是在输出的第二部分说用简单的选择排序。。

我按选择排序写了一个

var
a:array[1..1000] of longint;
i,j,n,k,l:longint;
begin
readln(n);
for i:=1 to n do read(a[i]);
writeln('Source:');
for i:=1 to n do write(a[i],' ');
writeln;
writeln('Bubble Sort:');
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
k:=a[i];a[i]:=a[j];a[j]:=k;
for l:=1 to n do write(a[l],' ');
writeln;
end;
writeln('Result');
for i:=1 to n do write(a[i],' ');
end.

有样例么,没有样例的话不好说