I - Vitya in the Countryside

I - Vitya in the Countryside
I - Vitya in the Countryside
I - Vitya in the Countryside

#include <iostream>
using namespace std;

int main()
{
    int n,a[199];
    cin>>n;
    for(int i=1;i<=n;i++)
    cin>>a[i];
    if(n==1)
    {
    	if(a[1]==15)
    	cout<<"DOWN"<<endl;
    	if(a[1]==0)
    	cout<<"UP"<<endl;
    	if(a[1]>=1&&a[1]<=14)
    	cout<<"-1"<<endl;
	}
    if(n>1)
    {
    	
	if(a[n]==15)
	cout<<"DOWN"<<endl;
	if(a[n]==0)
	cout<<"UP"<<endl;
	if(a[n-1]<a[n]&&a[n]<15)
	cout<<"UP"<<endl;
	if(a[n-1]>a[n]&&a[n]!=0)
	cout<<"DOWN"<<endl;
    	
	}
    return 0;
}

题上给的那一堆数字很重要啊,做的时候觉得自己挺对的,然后错了5次~~~~~

上一篇:快速证明199的200次方大于200的199次方


下一篇:怎样产生源源不断的被动收入?知识付费创业安排上!