Skip to content

Instantly share code, notes, and snippets.

@rogerioagjr
Last active June 7, 2016 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogerioagjr/307b377206c0f5a326b66bcf55b67c2a to your computer and use it in GitHub Desktop.
Save rogerioagjr/307b377206c0f5a326b66bcf55b67c2a to your computer and use it in GitHub Desktop.
Plantação de Morango
// Plantação de Morango - F1PJ - OBI 2016
// Rogério Júnior
// Complexidade: O(1)
#include <cstdio> // scanf e printf
int main(){
// declaro as variáveis que vou usar
int a1, a2, b1, b2;
// leio os valores dos lados dos retângulos
scanf("%d %d %d %d", &a1, &a2, &b1, &b2);
// se o primeiro retângulo tiver a maior área
if(a1*a2>b1*b2){
// imprimo a área do primeiro retângulo
printf("%d\n", a1*a2);
}
// caso contrário
else{
// imprimo a área do segundo retângulo
printf("%d\n", b1*b2);
}
// ao fim do programa, retorno 0
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment