<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comentarios en: Una ayuda para el lechero y para Memo</title>
	<atom:link href="http://www.elcodigok.com.ar/2008/11/una-ayuda-para-el-lechero-y-para-memo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elcodigok.com.ar/2008/11/una-ayuda-para-el-lechero-y-para-memo/</link>
	<description>Un blog de Ayuda a Programadores</description>
	<lastBuildDate>Wed, 08 Feb 2012 15:37:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Por: soliqui</title>
		<link>http://www.elcodigok.com.ar/2008/11/una-ayuda-para-el-lechero-y-para-memo/comment-page-1/#comment-15678</link>
		<dc:creator>soliqui</dc:creator>
		<pubDate>Thu, 27 Nov 2008 05:05:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.elcodigok.com.ar/?p=634#comment-15678</guid>
		<description>Otra solución del lechero...

C8&#124;CJ5&#124;CJ3
8  &#124; 0 &#124;  0  litros .... Asi comienza
0  &#124; 5 &#124;  3 
3  &#124; 5 &#124;  0
3  &#124; 2 &#124;  3
6  &#124; 2 &#124;  0
6  &#124; 0 &#124;  2
1  &#124; 5 &#124;  2
1  &#124; 4 &#124;  3  Litros... y tenemos una jarra con 4 litros</description>
		<content:encoded><![CDATA[<p>Otra solución del lechero&#8230;</p>
<p>C8|CJ5|CJ3<br />
8  | 0 |  0  litros &#8230;. Asi comienza<br />
0  | 5 |  3<br />
3  | 5 |  0<br />
3  | 2 |  3<br />
6  | 2 |  0<br />
6  | 0 |  2<br />
1  | 5 |  2<br />
1  | 4 |  3  Litros&#8230; y tenemos una jarra con 4 litros</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Flor de Maria</title>
		<link>http://www.elcodigok.com.ar/2008/11/una-ayuda-para-el-lechero-y-para-memo/comment-page-1/#comment-15677</link>
		<dc:creator>Flor de Maria</dc:creator>
		<pubDate>Thu, 27 Nov 2008 02:13:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.elcodigok.com.ar/?p=634#comment-15677</guid>
		<description>El problema del lechero se resuelve de la siguiente manera:
empezamos por vaciar el de 8 en el de 3 asi tenemos :
8 lts contiene 5 lts
5 lts contiene 0 lts
3 lts contiene 3 lts y entonces vaciamos lo que contiene el cantaro de 3 lts al de 5 lts y tenemos que:
8 lts contiene 5 lts
5 lts contiene 3 lts
3 lts contiene 0 lts y entonces vaciamos lo que contiene el cantaro de 8 lts al de 3 lts y tenemos que:
8 lts contiene 2lts
5 lts contiene 3 lts
3 lts contiene 3 lts y  entonces vaciamos lo que contiene el cantaro de 3 lts al de 5 lts y tenemos que:
8 lts contiene 2lts
5 lts contiene 5 lts
3 lts contiene 1 lts y  entonces vaciamos lo que contiene el cantaro de 5 lts al de 8 lts y tenemos que:
8 lts contiene 7lts
5 lts contiene 0 lts
3 lts contiene 1 lts y  entonces vaciamos lo que contiene el cantaro de 3 lts al de 5lts y tenemos que:
8 lts contiene 7 lts
5 lts contiene 1 lts
3 lts contiene 0 lts y  entonces vaciamos lo que contiene el cantaro de 8 lts al de 3 lts y tenemos que:
8 lts contiene 4lts
5 lts contiene 1 lts
3 lts contiene 3 lts y  entonces vaciamos lo que contiene el cantaro de 3 lts al de 5 lts y tenemos que:
8 lts contiene 4lts
5 lts contiene 4 lts
3 lts contiene 0 lts 

espero no haya otra manera mas corta :P
saludos</description>
		<content:encoded><![CDATA[<p>El problema del lechero se resuelve de la siguiente manera:<br />
empezamos por vaciar el de 8 en el de 3 asi tenemos :<br />
8 lts contiene 5 lts<br />
5 lts contiene 0 lts<br />
3 lts contiene 3 lts y entonces vaciamos lo que contiene el cantaro de 3 lts al de 5 lts y tenemos que:<br />
8 lts contiene 5 lts<br />
5 lts contiene 3 lts<br />
3 lts contiene 0 lts y entonces vaciamos lo que contiene el cantaro de 8 lts al de 3 lts y tenemos que:<br />
8 lts contiene 2lts<br />
5 lts contiene 3 lts<br />
3 lts contiene 3 lts y  entonces vaciamos lo que contiene el cantaro de 3 lts al de 5 lts y tenemos que:<br />
8 lts contiene 2lts<br />
5 lts contiene 5 lts<br />
3 lts contiene 1 lts y  entonces vaciamos lo que contiene el cantaro de 5 lts al de 8 lts y tenemos que:<br />
8 lts contiene 7lts<br />
5 lts contiene 0 lts<br />
3 lts contiene 1 lts y  entonces vaciamos lo que contiene el cantaro de 3 lts al de 5lts y tenemos que:<br />
8 lts contiene 7 lts<br />
5 lts contiene 1 lts<br />
3 lts contiene 0 lts y  entonces vaciamos lo que contiene el cantaro de 8 lts al de 3 lts y tenemos que:<br />
8 lts contiene 4lts<br />
5 lts contiene 1 lts<br />
3 lts contiene 3 lts y  entonces vaciamos lo que contiene el cantaro de 3 lts al de 5 lts y tenemos que:<br />
8 lts contiene 4lts<br />
5 lts contiene 4 lts<br />
3 lts contiene 0 lts </p>
<p>espero no haya otra manera mas corta <img src='http://www.elcodigok.com.ar/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
saludos</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Matias</title>
		<link>http://www.elcodigok.com.ar/2008/11/una-ayuda-para-el-lechero-y-para-memo/comment-page-1/#comment-15668</link>
		<dc:creator>Matias</dc:creator>
		<pubDate>Sun, 23 Nov 2008 03:14:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.elcodigok.com.ar/?p=634#comment-15668</guid>
		<description>Y en menos lineas de codigo, pero mas ineficiente

def piramide(n):
for i in range(1,n+1):
print  &quot;&quot;.join(map(str, range(1,i+1)) + &quot;&quot;.join(map(str,range(i-1,0,-1)))

por eso me gusta.....</description>
		<content:encoded><![CDATA[<p>Y en menos lineas de codigo, pero mas ineficiente</p>
<p>def piramide(n):<br />
for i in range(1,n+1):<br />
print  &#8220;&#8221;.join(map(str, range(1,i+1)) + &#8220;&#8221;.join(map(str,range(i-1,0,-1)))</p>
<p>por eso me gusta&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Matias</title>
		<link>http://www.elcodigok.com.ar/2008/11/una-ayuda-para-el-lechero-y-para-memo/comment-page-1/#comment-15667</link>
		<dc:creator>Matias</dc:creator>
		<pubDate>Sun, 23 Nov 2008 02:01:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.elcodigok.com.ar/?p=634#comment-15667</guid>
		<description>Amo python :P
Hace poquito q lo uso y me parece genial.

def escalera(n):
    up = &#039;&#039;
    down = &#039;&#039;
    for i in range(1,n+1):
        up += str(i)
        if i&gt;1:
            down = str(i-1) + down
        print up+down</description>
		<content:encoded><![CDATA[<p>Amo python <img src='http://www.elcodigok.com.ar/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
Hace poquito q lo uso y me parece genial.</p>
<p>def escalera(n):<br />
    up = &#8221;<br />
    down = &#8221;<br />
    for i in range(1,n+1):<br />
        up += str(i)<br />
        if i&gt;1:<br />
            down = str(i-1) + down<br />
        print up+down</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: aabilio</title>
		<link>http://www.elcodigok.com.ar/2008/11/una-ayuda-para-el-lechero-y-para-memo/comment-page-1/#comment-15658</link>
		<dc:creator>aabilio</dc:creator>
		<pubDate>Fri, 21 Nov 2008 18:11:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.elcodigok.com.ar/?p=634#comment-15658</guid>
		<description>Nada los comentario se come parte del código...
Dejo enlace al programa en general: http://linfox.es/docs/C/MEMO.cpp</description>
		<content:encoded><![CDATA[<p>Nada los comentario se come parte del código&#8230;<br />
Dejo enlace al programa en general: <a href="http://linfox.es/docs/C/MEMO.cpp" rel="nofollow">http://linfox.es/docs/C/MEMO.cpp</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: aabilio</title>
		<link>http://www.elcodigok.com.ar/2008/11/una-ayuda-para-el-lechero-y-para-memo/comment-page-1/#comment-15657</link>
		<dc:creator>aabilio</dc:creator>
		<pubDate>Fri, 21 Nov 2008 17:00:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.elcodigok.com.ar/?p=634#comment-15657</guid>
		<description>No se ha puesto bien la función (sin contar que el for en el que se disminuye el la variable &quot;b&quot; por supuesto son dos menos y no uno &gt;&gt; b--):

int piramide(int alt) {
    int i, b;
    for (i=1; i&lt;=alt; i++) {
        for (b=1; b=1; b--) {
            printf(&quot;%d&quot;, b);
        }
        printf(&quot;\n&quot;);
    }
}</description>
		<content:encoded><![CDATA[<p>No se ha puesto bien la función (sin contar que el for en el que se disminuye el la variable &#8220;b&#8221; por supuesto son dos menos y no uno &gt;&gt; b&#8211;):</p>
<p>int piramide(int alt) {<br />
    int i, b;<br />
    for (i=1; i&lt;=alt; i++) {<br />
        for (b=1; b=1; b&#8211;) {<br />
            printf(&#8220;%d&#8221;, b);<br />
        }<br />
        printf(&#8220;\n&#8221;);<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: aabilio</title>
		<link>http://www.elcodigok.com.ar/2008/11/una-ayuda-para-el-lechero-y-para-memo/comment-page-1/#comment-15656</link>
		<dc:creator>aabilio</dc:creator>
		<pubDate>Fri, 21 Nov 2008 16:57:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.elcodigok.com.ar/?p=634#comment-15656</guid>
		<description>Una función en C para el programa podría ser:

int piramide(int alt) {
    int i, b;
    for (i=1; i&lt;=alt; i++) {
        for (b=1; b=1; b--) {
            printf(&quot;%d&quot;, b);
        }
        printf(&quot;\n&quot;);
    }
}

Suponiendo que &quot;alt&quot; es el número introducido para la altura que se pediría desde la función principal, por ejemplo:

int main() {
    int altura;
    printf(&quot;Qué altura: &quot;);
    scanf(&quot;%d&quot;, &amp;altura);
    piramide(altura);
    
    PARAR;
    return 0;
}</description>
		<content:encoded><![CDATA[<p>Una función en C para el programa podría ser:</p>
<p>int piramide(int alt) {<br />
    int i, b;<br />
    for (i=1; i&lt;=alt; i++) {<br />
        for (b=1; b=1; b&#8211;) {<br />
            printf(&#8220;%d&#8221;, b);<br />
        }<br />
        printf(&#8220;\n&#8221;);<br />
    }<br />
}</p>
<p>Suponiendo que &#8220;alt&#8221; es el número introducido para la altura que se pediría desde la función principal, por ejemplo:</p>
<p>int main() {<br />
    int altura;<br />
    printf(&#8220;Qué altura: &#8220;);<br />
    scanf(&#8220;%d&#8221;, &amp;altura);<br />
    piramide(altura);</p>
<p>    PARAR;<br />
    return 0;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Memo</title>
		<link>http://www.elcodigok.com.ar/2008/11/una-ayuda-para-el-lechero-y-para-memo/comment-page-1/#comment-15655</link>
		<dc:creator>Memo</dc:creator>
		<pubDate>Fri, 21 Nov 2008 14:41:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.elcodigok.com.ar/?p=634#comment-15655</guid>
		<description>Hey no me funcionó, no lo puedo compilar en turbo c, por favor ayudame a resolver ese problema, memo88...</description>
		<content:encoded><![CDATA[<p>Hey no me funcionó, no lo puedo compilar en turbo c, por favor ayudame a resolver ese problema, memo88&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Tehsis</title>
		<link>http://www.elcodigok.com.ar/2008/11/una-ayuda-para-el-lechero-y-para-memo/comment-page-1/#comment-15654</link>
		<dc:creator>Tehsis</dc:creator>
		<pubDate>Fri, 21 Nov 2008 09:38:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.elcodigok.com.ar/?p=634#comment-15654</guid>
		<description>maldito python y sus sangrias...</description>
		<content:encoded><![CDATA[<p>maldito python y sus sangrias&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Por: Tehsis</title>
		<link>http://www.elcodigok.com.ar/2008/11/una-ayuda-para-el-lechero-y-para-memo/comment-page-1/#comment-15653</link>
		<dc:creator>Tehsis</dc:creator>
		<pubDate>Fri, 21 Nov 2008 09:37:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.elcodigok.com.ar/?p=634#comment-15653</guid>
		<description>Esta es mi solución para el problema de memo (en Python)..
Estoy seguro que debe haber una forma más limpia de hacerlo, pero bueno, es lo que me salio :P

def piramide(n):
	i = 1
	while n&gt;=i:
		a = 0
		for j in range((i*2)-1):
			if j &lt; i:
			  a = a + 1
			else:
			  a = a - 1
			print a ,
		print
		i = i+1

piramide(7)</description>
		<content:encoded><![CDATA[<p>Esta es mi solución para el problema de memo (en Python)..<br />
Estoy seguro que debe haber una forma más limpia de hacerlo, pero bueno, es lo que me salio <img src='http://www.elcodigok.com.ar/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>def piramide(n):<br />
	i = 1<br />
	while n&gt;=i:<br />
		a = 0<br />
		for j in range((i*2)-1):<br />
			if j &lt; i:<br />
			  a = a + 1<br />
			else:<br />
			  a = a &#8211; 1<br />
			print a ,<br />
		print<br />
		i = i+1</p>
<p>piramide(7)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

