Created
May 28, 2020 00:28
-
-
Save gbrls/41e5fce347850afb24f35a1c780ed3d4 to your computer and use it in GitHub Desktop.
OBI 2014 fase 1 Cartas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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