#include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int i, j, t;
vector <int> v;
scanf("%d", &t);
while(t--) {
scanf("%d", &j);
v.push_back(j);
}
if(is_sorted(v.begin(), v.end()))
printf("Sorted\n");
else
printf("Unsorted\n");
return 0;
}
Here's my C++ code to check whether a vector is sorted or not. But my IDE (Code Blocks) doesn't compile it and gives the message "is_sorted was not declared in this scope". What's wrong with this code?