Last active
June 7, 2016 17:36
-
-
Save rogerioagjr/307b377206c0f5a326b66bcf55b67c2a to your computer and use it in GitHub Desktop.
Plantação de Morango
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
// 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