Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> ans(N);
  for(int i=0;i<N;i++){
    cin >> ans.at(i);
  }
  sort(ans.begin(0),ans.end(N-1));
  for(int i=0;i<N:i++){
    cout<<ans.at(i)+1<<" ";
  }
  cout << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: no matching function for call to 'std::vector<int>::begin(int)'
   10 |   sort(ans.begin(0),ans.end(N-1));
      |        ~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:873:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::begin() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]'
  873 |       begin() _GLIBCXX_NOEXCEPT
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:873:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:883:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_iterator std::vector<_Tp, _Alloc>::begin() const [with _Tp = int; _Alloc = std::allocator<int>; const_iterator = std::vector<int>::const_iterator]'
  883 |       begin() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:883:7: note:   candidate expects 0 arguments, 1 provided
a.cc:10:28: error: no matching function for call to 'std::vector<int>::end(int)'
   10 |   sort(ans.begin(0),ans.end(N-1));
      |                     ~~~~~~~^~~~~
/usr/include/c++/14/bits/stl_vector.h:893:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::end() [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator]'
  893 |       end() _GLIBCXX_NOEXCEPT
      |       ^~~
/usr/include/c++/14/bits/stl_vector.h:893:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:903:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_iterator std::vector<_Tp, _Alloc>::end() const [with _Tp = int; _Alloc = std::allocator<int>; const_iterator = std::vector<int>::const_iterator]'
  903 |       end() const _GLIBCXX_NOEXCEPT
      |       ^~~
/usr/include/c++/14/bits/stl_vector.h:903:7: note:   candidate expects 0 arguments, 1 provided
a.cc:11:15: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   11 |   for(int i=0;i<N:i++){
      |               ^
a.cc:11:18: error: found ':' in nested-name-specifier, expected '::'
   11 |   for(int i=0;i<N:i++){
      |                  ^
      |                  ::
a.cc:11:17: error: 'N' is not a class, namespace, or enumeration
   11 |   for(int i=0;i<N:i++){
      |                 ^
a.cc:15:1: error: expected primary-expression before '}' token
   15 | }
      | ^
a.cc:14:16: error: expected ')' before '}' token
   14 |   cout << endl;
      |                ^
      |                )
   15 | }
      | ~               
a.cc:11:6: note: to match this '('
   11 |   for(int i=0;i<N:i++){
      |      ^
a.cc:15:1: error: expected primary-expression before '}' token
   15 | }
      | ^