Skip to content

Instantly share code, notes, and snippets.

@rogerioagjr
Created May 25, 2015 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogerioagjr/85f3c44aeb4189f5d519 to your computer and use it in GitHub Desktop.
Save rogerioagjr/85f3c44aeb4189f5d519 to your computer and use it in GitHub Desktop.
Competição de Chocolate
#include <cstdio>
int n, m;
int main(){
// leio os valores de n e m
scanf("%d %d", &n, &m);
// se n for múltiplo de m+1, Carlos ganha
if(n%(m+1)==0) printf("Carlos\n");
// Caso contrário, Paula ganha
else printf("Paula\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment