Created
July 6, 2015 08:51
-
-
Save rogerioagjr/aa3113363660c524cbd2 to your computer and use it in GitHub Desktop.
Campeonato
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
#include <cstdio> | |
int main(){ | |
// declaro e leio os resultados dos times | |
int cv, ce, cs, fv, fe, fs, pc, pf; | |
scanf("%d %d %d %d %d %d", &cv, &ce, &cs, &fv, &fe, &fs); | |
// calculo os pontos obtidos por eles | |
pc=3*cv+ce; | |
pf=3*fv+fe; | |
// se algum tiver mais pontos, imprimo seu caractere | |
if(pc>pf) printf("C\n"); | |
if(pc<pf) printf("F\n"); | |
// se eles estiverem empatados nos pontos | |
if(pc==pf){ | |
// se algum deles ganahr no saldo, mprimo seu caractere | |
if(cs>fs) printf("C\n"); | |
if(cs<fs) printf("F\n"); | |
// e imprimo '=' caso o empate persista | |
if(cs==fs) printf("=\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment