Odpowiedź:
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a,b;
cin>>n;
for(int i = 0;i < n;i++)
{
a = b;
cin>>b;
}
if(n == 1)
{
if(b == 15)
cout<<"DOWN";
else if(b == 0)
cout<<"UP";
else
cout<<"UNKNOWN";
}
else if(b == 0 || (b > a && b != 15))
cout<<"UP";
else
cout<<"DOWN";
}
Wyjaśnienie: