Jump to content
Sign in to follow this  
msmsms

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

Recommended Posts

msmsms

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*/
/*dinheiro*/
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
HappyHippyHippo

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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.