#include <iostream> include <vector> using namespace std; int main() { int n; cin>>n; int vector a(n); for(int i=0;i<n;i++) cin>>a[i]; if(a[n-1]==0) cout<<"UP"; else if(a[n-1]==15) cout<<"DOWN"; else if(n>1) { if(a[n-1]>a[n-2]) cout<<"UP"; if(a[n-1]<a[n-2]) cout<<"DOWN"; } else cout<<"-1"; return 0; }
5 3 4 5 6 7
prog.cpp:2:1: error: ‘include’ does not name a type include <vector> ^~~~~~~ prog.cpp: In function ‘int main()’: prog.cpp:8:1: error: ‘cin’ was not declared in this scope cin>>n; ^~~ prog.cpp:8:1: note: suggested alternative: In file included from prog.cpp:1:0: /usr/include/c++/6/iostream:60:18: note: ‘std::cin’ extern istream cin; /// Linked to standard input ^~~ prog.cpp:10:13: error: expected initializer before ‘a’ int vector a(n); ^ prog.cpp:12:7: error: ‘a’ was not declared in this scope cin>>a[i]; ^ prog.cpp:14:4: error: ‘a’ was not declared in this scope if(a[n-1]==0) ^ prog.cpp:15:2: error: ‘cout’ was not declared in this scope cout<<"UP"; ^~~~ prog.cpp:15:2: note: suggested alternative: In file included from prog.cpp:1:0: /usr/include/c++/6/iostream:61:18: note: ‘std::cout’ extern ostream cout; /// Linked to standard output ^~~~ prog.cpp:17:2: error: ‘cout’ was not declared in this scope cout<<"DOWN"; ^~~~ prog.cpp:17:2: note: suggested alternative: In file included from prog.cpp:1:0: /usr/include/c++/6/iostream:61:18: note: ‘std::cout’ extern ostream cout; /// Linked to standard output ^~~~ prog.cpp:21:4: error: ‘cout’ was not declared in this scope cout<<"UP"; ^~~~ prog.cpp:21:4: note: suggested alternative: In file included from prog.cpp:1:0: /usr/include/c++/6/iostream:61:18: note: ‘std::cout’ extern ostream cout; /// Linked to standard output ^~~~ prog.cpp:23:4: error: ‘cout’ was not declared in this scope cout<<"DOWN"; ^~~~ prog.cpp:23:4: note: suggested alternative: In file included from prog.cpp:1:0: /usr/include/c++/6/iostream:61:18: note: ‘std::cout’ extern ostream cout; /// Linked to standard output ^~~~ prog.cpp:26:2: error: ‘cout’ was not declared in this scope cout<<"-1"; ^~~~ prog.cpp:26:2: note: suggested alternative: In file included from prog.cpp:1:0: /usr/include/c++/6/iostream:61:18: note: ‘std::cout’ extern ostream cout; /// Linked to standard output ^~~~
Standard output is empty