Skip to content

Instantly share code, notes, and snippets.

@gbrls
Created May 28, 2020 00:28
Show Gist options
  • Save gbrls/41e5fce347850afb24f35a1c780ed3d4 to your computer and use it in GitHub Desktop.
Save gbrls/41e5fce347850afb24f35a1c780ed3d4 to your computer and use it in GitHub Desktop.
OBI 2014 fase 1 Cartas
#include <bits/stdc++.h>
using namespace std;
int n=5;
int main() {
int c=1,d=1;
int arr[n];
for(int i=0;i<n;i++) cin>>arr[i];
for(int i=1;i<n;i++) {
if(arr[i] <= arr[i-1]) c=0;
if(arr[i] >= arr[i-1]) d=0;
}
if(c) {
puts("C");
} else if(d) {
puts("D");
} else {
puts("N");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment