Skip to content

Instantly share code, notes, and snippets.

@rogerioagjr
Created June 8, 2016 11:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogerioagjr/1976886a93bda94dc6c0939691b0eff1 to your computer and use it in GitHub Desktop.
Save rogerioagjr/1976886a93bda94dc6c0939691b0eff1 to your computer and use it in GitHub Desktop.
Clube dos Cinco
// 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