利用内置sort()函数排序 C++函数

Sort the given sequence in non-decreasing order.
Input
One line contains a sequence of no more than 105 integers.
Output
Print in one line a sequence of numbers in non-decreasing order.
按非递减顺序对给定序列进行排序。
输入
每行包含不超过105个整数的序列。
输出
在一行中打印非递减顺序的数字序列。
Sample
Input Output
4 1 4 8 6 6 5 1 4 4 5 6 6 8

有啥问题啊,sort(a,a+n)这样子啊

#include <iostream>
using namespace std;
#include<algorithm>
int main()
{
    int a[105];
    for(int i=0;i<105;i++)
        cin>>a[i];
    sort(a,a+105);
    for(int i=0;i<105;i++)
        cout<<a[i]<<" ";
}