Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: JRomsponCH
Problemset: เธอ ๆ มันเรียงกันยังไงอะ
Language: cpp
Time: 0.003 second
Submitted On: 2025-09-30 12:55:38
#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;
break;
}
}
if (check == false) {
cout<<"sorted!";
}
}else{
cout<<"sorted!";
}
}