Skip to content

Instantly share code, notes, and snippets.

@rogerioagjr
Last active May 25, 2017 15:25
Show Gist options
  • Save rogerioagjr/fdf63bebb590c1faf0a0a9835c18fcf0 to your computer and use it in GitHub Desktop.
Save rogerioagjr/fdf63bebb590c1faf0a0a9835c18fcf0 to your computer and use it in GitHub Desktop.
Drone de Entrega
// Drone de Entrega - F1PJ - OBI 2017
// Rogério Júnior
// Complexidade: O(1)
#include <cstdio> // scanf e printf
int main(){
// declaro e leio os valores de A, B, C, H e L
int a, b, c, h, l;
scanf("%d %d %d %d %d", &a, &b, &c, &h, &l);
// se alguma das maneiras de passar o cubo funcionar
if((a<=h and b<=l) or (a<=l and b<=h) or (a<=h and c<=l) or (a<=l and c<=h) or (b<=h and c<=l) or (b<=l and c<=h)){
printf("S\n"); // imprimimos o caractere 'S'
}
// caso nenhuma funcione
else{
printf("N\n"); // imprimimos o caractere 'N'
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment