fork download
  1. using static System.Console;
  2.  
  3. public class Program {
  4. public static void Main() {
  5. if (!decimal.TryParse(ReadLine(), out var n)) return;
  6. var resto = (int)(n * 100);
  7. WriteLine("NOTAS:");
  8. WriteLine($"{resto / 10000} nota(s) de R$ 100.00");
  9. resto %= 10000;
  10. WriteLine($"{resto / 5000} nota(s) de R$ 50.00");
  11. resto %= 5000;
  12. WriteLine($"{resto / 2000} nota(s) de R$ 20.00");
  13. resto %= 2000;
  14. WriteLine($"{resto / 1000} nota(s) de R$ 10.00");
  15. resto %= 1000;
  16. WriteLine($"{resto / 500} nota(s) de R$ 5.00");
  17. resto %= 500;
  18. WriteLine($"{resto / 200} nota(s) de R$ 2.00");
  19. WriteLine("MOEDAS:");
  20. resto %= 200;
  21. WriteLine($"{resto / 100} moeda(s) de R$ 1.00");
  22. resto %= 100;
  23. WriteLine($"{resto / 50} moeda(s) de R$ 0.50");
  24. resto %= 50;
  25. WriteLine($"{resto / 25} moeda(s) de R$ 0.25");
  26. resto %= 25;
  27. WriteLine($"{resto / 10} moeda(s) de R$ 0.10");
  28. resto %= 10;
  29. WriteLine($"{resto / 5} moeda(s) de R$ 0.05");
  30. resto %= 5;
  31. WriteLine($"{resto} moeda(s) de R$ 0.01");
  32. }
  33. }
  34.  
  35. //https://pt.stackoverflow.com/q/364588/101
Success #stdin #stdout 0.02s 15948KB
stdin
Standard input is empty
stdout
Standard output is empty