Created
June 8, 2016 11:28
-
-
Save rogerioagjr/1976886a93bda94dc6c0939691b0eff1 to your computer and use it in GitHub Desktop.
Clube dos Cinco
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
// Clube dos Cinco - F1P1 - OBI 2016 | |
// Rogério Júnior | |
// Complexidade: O(1) | |
#include <cstdio> // scanf e printf | |
int main(){ | |
// declaro e leio as variáveis que vou usar | |
int n, a, b, c, d, e, f, g; | |
scanf("%d %d %d %d %d %d %d %d", &n, &a, &b, &c, &d, &e, &f, &g); | |
// se a igualdade for verdadeira, ninguém está mentindo | |
if(n==a+b+c-d-e-f+g) printf("N\n"); | |
// caso contrário, há um mentiroso | |
else printf("S\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment