请问一个C语言问题 - - 一直【Presentation Error】
DescriptionGive a set of numbers, output them after sort. You may use any algorithm you like to solve it.
Input
Each input file contains only one case.
Each test case begins with an integer N(0<N<=1000), the size of the set.
The Next line contains N numbers, represent the elements of the set. Each number range in [0..65535]
Output
Output the set in one line after sort.
Each pair of adjacent numbers is separated by one space. There is no space but '\n' at the end of the line.
Sample Input
4
4 15 8 5
Sample Output
4 5 8 15
我的解法 - -
#include<stdio.h>
int main()
{
int a[50];
int l,i,j,t;
scanf("%d",&l);
for(i=0;i<l;i++)
scanf("%d",&a[i]);
printf("\n");
for(j=0;j<l-1;j++)
for(i=0;i<l-j-1;i++)
if(a[i]>a[i+1])
{
t=a[i];
a[i]=a[i+1];
a[i+1]=t;
}
for(i=0;i<l;i++)
printf("%d ",a[i]);
printf("\n");
}
oj表示【Presentation Error】···
请问是哪里出问题了呢 看了老半天了