Skip to content

Instantly share code, notes, and snippets.

@rogerioagjr
Created April 22, 2015 17:15
Show Gist options
  • Save rogerioagjr/73d59697935b979defb8 to your computer and use it in GitHub Desktop.
Save rogerioagjr/73d59697935b979defb8 to your computer and use it in GitHub Desktop.
O Maior
#include <cstdio> //scanf e printf
int main(){
int a, b, c; // declaro as variáveis a, b e c
scanf("%d %d %d", &a, &b, &c); // leio os números na tela e salvo em a, b e c
if(a>=b && a>=c) printf("%d eh o maior\n", a); // se a for maior ou igual que b e c, ela é a maior
else{ // senão
if(b>=a && b>=c) printf("%d eh o maior\n", b); // se b for maior ou igual que a e c, ela é a maior
else printf("%d eh o maior\n", c); // se não foi a nem b, então c é a maior
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment