Skip to content

Instantly share code, notes, and snippets.

@antonio-abrantes
Created August 23, 2016 14:18
Show Gist options
  • Save antonio-abrantes/130197ce60c654d6afc42782acf1a9d4 to your computer and use it in GitHub Desktop.
Save antonio-abrantes/130197ce60c654d6afc42782acf1a9d4 to your computer and use it in GitHub Desktop.
Codigo em construcao
#include <stdio.h>
#include <stdlib.h>
int main()
{
int fink = 0, pica = 0, comida = 0;
scanf("%d", &comida);
int i = 0;
while(comida > 0)
{
pica = pica + 1;
comida--;
i++;
if(comida < pica)
break;
fink = fink + pica;
comida -= pica;
}
if(comida > 0){
printf("Entrou\n");
}
printf("%d %d\n", i, comida);
printf("%d %d\n",fink, pica );
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment