Submission
Status:
---PPP-P-P
Subtask/Task Score:
50/100
Score: 50
User: JRomsponCH
Problemset: เธอ ๆ มันเรียงกันยังไงอะ
Language: cpp
Time: 0.002 second
Submitted On: 2025-09-30 12:51:41
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int arr[n];
bool check = false;
for (int i = 0; i < n; i++) {
cin>>arr[i];
}
if (n != 0) {
for (int i = 0; i < n-1; i++) {
if (arr[i] > arr[i+1]) {
cout<<"un-sorted!";
check = true;
}
}
if (check == false) {
cout<<"sorted!";
}
}else{
cout<<"sorted!";
}
}