Created
June 8, 2015 17:18
-
-
Save rogerioagjr/1c760aeb1fde244b5ec3 to your computer and use it in GitHub Desktop.
Móbile
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
// 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