Informática, perguntado por rochard11250, 4 meses atrás

Faça um algoritmo que peça um valor monetário (sem centavos) e forneça a menor quantidade de cada nota/moeda perfazendo o valor informado. Dica: Comece obtendo a divisão inteira a partir das notas maiores (R$ 100,00; R$ 50,00; R$ 20,00; R$ 10,00; R$ 5,00; R$ 2,00 e R$ 1,00). Ex.: R$ 278,00 ↔ 2 notas de R$ 100,00, 1 nota de R$ 50,00, 1 nota de R$ 20,00, 1 nota de R$ 5,00, 1 nota de R$ 2,00 e 1 moeda de R$ 1,00.


uma ajudinha pfv​

Soluções para a tarefa

Respondido por UnicórnioGeek
1

Var

  A,B,C,D,G,F,NUM: INTEIRO

  M: REAL

Inicio

  NUM <- 1

  ENQUANTO (NUM <> 0) FACA

     ESCREVA("Informe um valor (sem centavos): ")

     LEIA(NUM)

     LIMPATELA

     M <- 1

     A <- 2

     B <- 5

     C <- 10

     D <- 20

     G <- 50

     F <- 100

     

     F <- int(NUM/F)

     G <- int((NUM-F*100)/G)

     D <- int(((NUM-F*100)-G*50)/D)

     C <- int((((NUM-F*100)-G*50)-D*20)/C)

     B <- int(((((NUM-F*100)-G*50)-D*20)-C*10)/B)

     A <- int((((((NUM-F*100)-G*50)-D*20)-C*10)-B*5)/A)

     M <- int((((((NUM-F*100)-G*50)-D*20)-C*10)-B*5)-A*2)/M)

     

    ESCREVA("VALOR MÍNIMO DE NOTAS:")

    ESCREVAL()

    ESCREVA(F," NOTA(S) DE 100 REAIS")

     ESCREVAL()

    ESCREVA(G," NOTA(S) DE 50 REAIS")

    ESCREVAL()

     ESCREVA(D," NOTA(S) DE 20 REAIS")

     ESCREVAL()

     ESCREVA(C," NOTA(S) DE 10 REAIS")

     ESCREVAL()

     ESCREVA(B," NOTA(S) DE 5 REAIS")

     ESCREVAL()

     ESCREVA(A," NOTA(S) DE 2 REAIS")

     ESCREVAL()

     ESCREVA(M," MODEDA(S) DE 1 REAL")

     ESCREVAL()

  FIMENQUANTO


rochard11250: nu vlw pela ajuda eu n ia conseguir sozinho
carlacampos0204: richard tu n cansa nunca
Perguntas interessantes