Skip to content

Instantly share code, notes, and snippets.

@rogerioagjr
Created June 8, 2015 17:18
Show Gist options
  • Save rogerioagjr/1c760aeb1fde244b5ec3 to your computer and use it in GitHub Desktop.
Save rogerioagjr/1c760aeb1fde244b5ec3 to your computer and use it in GitHub Desktop.
Móbile
// Móbile - F1PJ - OBI 2015
// Rogério Júnior
// Complexidade: O(1)
#include <cstdio> // scanf e printf
int main(){
// declaro e leio os valores de "a", "b", "c" e "d"
int a, b, c, d;
scanf("%d %d %d %d", &a, &b, &c, &d);
// se as condições do problema forem atendidas, imprima o caractere 'S'
if(a==b+c+d && b+c==d && b==c) printf("S\n");
// caso contrário, imprima uma linha com o caractere 'N'
else printf("N\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment