Skip to content

Instantly share code, notes, and snippets.

View fabiomascarenhas's full-sized avatar

Fabio Mascarenhas fabiomascarenhas

  • UFRJ
  • Rio de Janeiro, Brazil
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/*
Entrada: dinheiro e preço unitário
Saída: no. de bombons e troco
Tenho R$20 (2000) e o bombom custa R$1.50 (150)
Compro 13 (2000 / 150) e tenho R$0.50 (50 cent = 2000 % 150)