{"id":8490,"date":"2016-02-02T17:01:51","date_gmt":"2016-02-02T22:01:51","guid":{"rendered":"http:\/\/blog.espol.edu.ec\/ccpg1001\/?p=8490"},"modified":"2026-04-05T18:39:13","modified_gmt":"2026-04-05T23:39:13","slug":"s3eva2015ti_t1-maquina-con-monedas","status":"publish","type":"post","link":"https:\/\/blog.espol.edu.ec\/algoritmos101\/fp-s3eva20\/s3eva2015ti_t1-maquina-con-monedas\/","title":{"rendered":"s3Eva2015TI_T1 Maquina con monedas"},"content":{"rendered":"\n<p><em><strong>Ejercicios<\/strong><\/em>: <a href=\"https:\/\/blog.espol.edu.ec\/algoritmos101\/fp-3eva20\/3eva2015ti_t1-maquina-con-monedas\/\" data-type=\"post\" data-id=\"2679\">3Eva2015TI_T1 Maquina con monedas<\/a><\/p>\n\n\n\n<p>Video de concepto que incluye el ejercicio:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Vectores - Arreglos de una dimensi\u00f3n en Python\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/ya9CzhOXjrI?start=56&feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Algoritmo en Python<\/h2>\n\n\n\n<p>Literal a:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# ICM00794-Fundamentos de Computaci\u00f3n - FCNM-ESPOL\n# 3Eva_IT2015_T1 Maquina con monedas\nimport numpy as np\n\n# INGRESO\nvalor = float(input('valor: '))\n\n# PROCEDIMIENTO\ncentavos = (valor - int(valor))*100\ncentavos = int(centavos)\n\ncantidad    = np.zeros(4,dtype=int)\ncantidad&#x5B;0] = centavos\nnumero = int(valor)\n\ni = 1\nwhile not(numero == 0 or i&gt;=4):\n    digito = numero%10\n    numero = numero\/\/10\n    cantidad&#x5B;i] = digito\n    i = i + 1\n\n# SALIDA\nprint(cantidad)\n<\/pre><\/div>\n\n\n<p>prueba:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>valor: 435.16\n&#091;16  5  3  4]\n&gt;&gt;&gt; <\/code><\/pre>\n\n\n\n<p>tarea: convertir a funci\u00f3n<\/p>\n\n\n\n<p>literal b:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# ICM00794-Fundamentos de Computaci\u00f3n - FCNM-ESPOL\n# 3Eva_IT2015_T1 Maquina con monedas\nimport numpy as np\n\n# INGRESO\ncentavos = int(input('devolver: '))\n\n# PROCEDIMIENTO\nmonedas = np.array(&#x5B;1,5,10,25,50])\ntamano = len(monedas)\ndevolver = centavos\ncantidad = np.zeros(tamano, dtype = int)\ni = tamano - 1\nwhile not(i &lt; 0):\n    cantidad&#x5B;i] = devolver\/\/monedas&#x5B;i]\n    devolver = devolver%monedas&#x5B;i]\n    i = i-1\n\n# SALIDA\nprint(monedas)\nprint(cantidad)\n<\/pre><\/div>\n\n\n<p>prueba:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>devolver: 63\n&#091; 1  5 10 25 50]\n&#091;3 0 1 0 1]\n&gt;&gt;&gt; <\/code><\/pre>\n\n\n\n<p><strong><em>Tarea<\/em><\/strong>: convertir a funci\u00f3n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ejercicios: 3Eva2015TI_T1 Maquina con monedas Video de concepto que incluye el ejercicio: Algoritmo en Python Literal a: prueba: tarea: convertir a funci\u00f3n literal b: prueba: Tarea: convertir a funci\u00f3n<\/p>\n","protected":false},"author":8043,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"wp-custom-template-entrada-fp-ejemplos","format":"standard","meta":{"footnotes":""},"categories":[143],"tags":[58,157],"class_list":["post-8490","post","type-post","status-publish","format-standard","hentry","category-fp-s3eva20","tag-ejemplos-python","tag-fundamentos-programacion"],"_links":{"self":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/8490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/users\/8043"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/comments?post=8490"}],"version-history":[{"count":4,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/8490\/revisions"}],"predecessor-version":[{"id":23774,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/posts\/8490\/revisions\/23774"}],"wp:attachment":[{"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/media?parent=8490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/categories?post=8490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.espol.edu.ec\/algoritmos101\/wp-json\/wp\/v2\/tags?post=8490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}