Jump to content
Sign in to follow this  

devolver o menor numero de dinheiro para uma compra inferior a 100 euros

Recommended Posts


comecei por fazer assim:

alguém me pode ''orientar'' para resolver o que falta?

int main()
/*menor numero de moedas e de notas a devolver de troco para uma compra inferior a 100 euros*/
float n1=0.01;
float n2=0.05;
float n3=0.10;
float n4=0.20;
float n5=0.50;
float n6=1.00;
float n7=2.00;
float n8=5.00;
float n9=10.00;
float n10=20.00;
float n11=50.00;
float n12=100.00;
/*valor da compra*/
float total;
printf("total ");
scanf("%d", total);

Edited by msmsms

Share this post

Link to post
Share on other sites

dica : ignora o limite de compra inferior a 100 euros, só deverá estar a complicar o raciocínio ...

dica2 : dinheiro - compra = troco

dica 3 : divide (significado intrínseco da operação) o troco pelos valores de notas e moedas

IRC : sim, é algo que ainda existe >> #p@p

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.