O input é uma coisa só, você tem que lidar com a quebra de linha.<br><br><div class="gmail_quote">2010/7/25 Renato Santos <span dir="ltr">&lt;<a href="mailto:renato.cron@gmail.com">renato.cron@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Por exemplo,<div>se a entrada é </div><div><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:13px;color:rgb(0, 0, 32)"><pre style="font-size:13px;text-align:left">DO YOUR BEST<br>1 PLUS 1 EQUALS 2</pre>

<pre style="font-size:13px;text-align:left">Tenho que fazer o perl &quot;printar&quot; isso com &quot;\n&quot;?</pre><pre style="font-size:13px;text-align:left">Que dizer,</pre>

<pre style="font-size:13px;text-align:left">ele vai rodar o perl com &quot;DO YOUR BEST&quot; e depois &quot;1 PLUS 1 EQUALS 2&quot; ou tudo duma vez?</pre></span><div><div></div><div class="h5"><br><div class="gmail_quote">

2010/7/25 Pinguim Azul <span dir="ltr">&lt;<a href="mailto:bluepenguin@gmail.com" target="_blank">bluepenguin@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Esse não funciona porque o primeiro número do input é o número de elementos.<div><div></div><div><br><br><div class="gmail_quote">



2010/7/25 Renato Santos <span dir="ltr">&lt;<a href="mailto:renato.cron@gmail.com" target="_blank">renato.cron@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hmm, esse dai dava pau: <span style="font-family:Helvetica;font-size:13px;color:rgb(51, 51, 51)"><div style="width:900px">





<div style="margin-bottom:1em;padding-left:0.5em;padding-right:0.5em">

<ul style="list-style-type:none;list-style-position:initial;padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;margin-top:0px"><li style="padding-top:6px;padding-right:6px;padding-bottom:6px;padding-left:6px;background-color:rgb(234, 234, 234);margin-bottom:6px;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(208, 208, 208);border-right-color:rgb(208, 208, 208);border-bottom-color:rgb(208, 208, 208);border-left-color:rgb(208, 208, 208);background-repeat:initial initial">







<div style="display:block"><pre style="margin-top:0px;padding-top:0.5em;padding-right:0.5em;padding-bottom:0.5em;padding-left:0.5em;background-color:rgb(240, 240, 240);border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(153, 153, 153);border-right-color:rgb(153, 153, 153);border-bottom-color:rgb(153, 153, 153);border-left-color:rgb(153, 153, 153);color:rgb(0, 0, 102)">

Can&#39;t take log of 0 at <a href="http://prog.pl" target="_blank">prog.pl</a> line 1, &lt;&gt; line 4.
</pre></div></li></ul></div><div style="padding-left:0.5em"></div></div></span><div><br></div>Mas esse daki funciona, mas ta dando resposta errada, ai desisti!<div>Ja tentei botar &quot;\r\n&quot;, &quot;\n&quot;, tirar o \n, etc..</div>







<div><span style="font-family:Helvetica;font-size:13px;color:rgb(51, 51, 51)"><div style="margin-bottom:1em;padding-left:0.5em;padding-right:0.5em"><pre style="margin-top:0px"><table style="font-family:monospace;color:rgb(0, 0, 102);border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(208, 208, 208);border-right-color:rgb(208, 208, 208);border-bottom-color:rgb(208, 208, 208);border-left-color:rgb(208, 208, 208);background-color:rgb(240, 240, 240);padding-top:3px;padding-right:3px;padding-bottom:3px;padding-left:3px;width:880px">







<tbody><tr><td style="vertical-align:top"><pre style="margin-top:0px;margin-bottom:0px;padding-bottom:5px;padding-top:3px;padding-left:10px"><span style="line-height:13px !important;color:rgb(177, 177, 0)">for</span><span style="line-height:13px !important;color:rgb(0, 153, 0)">(</span><span style="line-height:13px !important;color:rgb(51, 153, 51)">&lt;&gt;</span><span style="line-height:13px !important;color:rgb(0, 153, 0)">)</span><span style="line-height:13px !important;color:rgb(0, 153, 0)">{</span><span style="line-height:13px !important;color:rgb(0, 0, 255)">$_</span> <span style="line-height:13px !important;color:rgb(51, 153, 51)">|=</span> <span style="line-height:13px !important;color:rgb(0, 0, 255)">$_</span><span style="line-height:13px !important;color:rgb(51, 153, 51)">&gt;&gt;</span><span style="line-height:13px !important;color:rgb(204, 102, 204)">1</span><span style="line-height:13px !important;color:rgb(51, 153, 51)">;</span> <span style="line-height:13px !important;color:rgb(0, 0, 255)">$_</span> <span style="line-height:13px !important;color:rgb(51, 153, 51)">|=</span> <span style="line-height:13px !important;color:rgb(0, 0, 255)">$_</span><span style="line-height:13px !important;color:rgb(51, 153, 51)">&gt;&gt;</span><span style="line-height:13px !important;color:rgb(204, 102, 204)">2</span><span style="line-height:13px !important;color:rgb(51, 153, 51)">;</span> <span style="line-height:13px !important;color:rgb(0, 0, 255)">$_</span> <span style="line-height:13px !important;color:rgb(51, 153, 51)">|=</span> <span style="line-height:13px !important;color:rgb(0, 0, 255)">$_</span><span style="line-height:13px !important;color:rgb(51, 153, 51)">&gt;&gt;</span><span style="line-height:13px !important;color:rgb(204, 102, 204)">4</span><span style="line-height:13px !important;color:rgb(51, 153, 51)">;</span> <span style="line-height:13px !important;color:rgb(0, 0, 255)">$_</span> <span style="line-height:13px !important;color:rgb(51, 153, 51)">|=</span> <span style="line-height:13px !important;color:rgb(0, 0, 255)">$_</span><span style="line-height:13px !important;color:rgb(51, 153, 51)">&gt;&gt;</span><span style="line-height:13px !important;color:rgb(204, 102, 204)">8</span><span style="line-height:13px !important;color:rgb(51, 153, 51)">;</span> <span style="line-height:13px !important;color:rgb(0, 0, 255)">$_</span> <span style="line-height:13px !important;color:rgb(51, 153, 51)">|=</span> <span style="line-height:13px !important;color:rgb(0, 0, 255)">$_</span><span style="line-height:13px !important;color:rgb(51, 153, 51)">&gt;&gt;</span><span style="line-height:13px !important;color:rgb(204, 102, 204)">16</span><span style="line-height:13px !important;color:rgb(51, 153, 51)">;</span>print <span style="line-height:13px !important;color:rgb(51, 153, 51)">++</span><span style="line-height:13px !important;color:rgb(0, 0, 255)">$_</span><span style="line-height:13px !important;color:rgb(51, 153, 51)">.</span><span style="line-height:13px !important;color:rgb(255, 0, 0)">&quot;<span style="line-height:13px !important;color:rgb(0, 0, 153);font-weight:bold">\n</span>&quot;</span><span style="line-height:13px !important;color:rgb(0, 153, 0)">}</span></pre>







</td></tr></tbody></table></pre></div><div style="margin-bottom:1em;padding-left:0.5em;padding-right:0.5em"></div></span><div><div></div><div><div class="gmail_quote">2010/7/25 Pinguim Azul <span dir="ltr">&lt;<a href="mailto:bluepenguin@gmail.com" target="_blank">bluepenguin@gmail.com</a>&gt;</span><br>







<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ele funciona mesmo se tiver um 0 na entrada?<br>
<div><br>
2010/7/25 Renato Santos &lt;<a href="mailto:renato.cron@gmail.com" target="_blank">renato.cron@gmail.com</a>&gt;:<br>
</div><div><div></div><div>&gt; agora eu eu vou fazer um super off topic!<br>
&gt; Estou tentando resolver um problema simples (next power of 2)<br>
&gt; mas ta dando erro em tempo de compilacao<br>
&gt; for(&lt;&gt;){$l=log($_)/log(2);$l=int($l+1)if $l!=int($l);print 2**$l.&quot;\n&quot;}<br>
&gt; Mas no ideone funciona<br>
&gt;<br>
&gt; 2010/7/25 Pinguim Azul &lt;<a href="mailto:bluepenguin@gmail.com" target="_blank">bluepenguin@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; 2010/7/25 Eden Cardim &lt;<a href="mailto:edencardim@gmail.com" target="_blank">edencardim@gmail.com</a>&gt;:<br>
&gt;&gt; &gt;&gt;&gt;&gt;&gt;&gt; &quot;Pinguim&quot; == Pinguim Azul &lt;<a href="mailto:bluepenguin@gmail.com" target="_blank">bluepenguin@gmail.com</a>&gt; writes:<br>
&gt;&gt; &gt;    Pinguim&gt; Nenhum dos dois vai funcionar, porque vocês ignoraram o<br>
&gt;&gt; &gt;    Pinguim&gt; primeiro número.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; O exemplo proposto em <a href="https://www.spoj.pl/SHORTEN/problems/SIZECON/" target="_blank">https://www.spoj.pl/SHORTEN/problems/SIZECON/</a> não<br>
&gt;&gt; &gt; é bem claro quanto ao que se deve fazer com entradas mal-formadas. Um<br>
&gt;&gt; &gt; exemplo melhor seria se demonstrar a saída pra esse caso. Isso<br>
&gt;&gt; &gt; provavelmente explica porque tem tantos erros para um problema tão<br>
&gt;&gt; &gt; fácil.<br>
&gt;&gt;<br>
&gt;&gt; Eu concordo que esse problema está mal escrito mesmo, mas eu acho que<br>
&gt;&gt; ele é exceção.<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Ricardo Bittencourt<br>
&gt;&gt; <a href="http://www.ricbit.com" target="_blank">http://www.ricbit.com</a><br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; SaoPaulo-pm mailing list<br>
&gt;&gt; <a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
&gt;&gt; <a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Renato Santos<br>
&gt; <a href="http://www.renatocron.com/blog/" target="_blank">http://www.renatocron.com/blog/</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; SaoPaulo-pm mailing list<br>
&gt; <a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
&gt; <a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
&gt;<br>
<br>
<br>
<br>
--<br>
Ricardo Bittencourt<br>
<a href="http://www.ricbit.com" target="_blank">http://www.ricbit.com</a><br>
_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Renato Santos<br><a href="http://www.renatocron.com/blog/" target="_blank">http://www.renatocron.com/blog/</a><br>
</div></div></div>
<br>_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br></blockquote></div><br><br clear="all"><br>-- <br>Ricardo Bittencourt<br><a href="http://www.ricbit.com" target="_blank">http://www.ricbit.com</a><br>






</div></div><br>_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org" target="_blank">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br></blockquote></div><br><br clear="all"><br>-- <br>Renato Santos<br><a href="http://www.renatocron.com/blog/" target="_blank">http://www.renatocron.com/blog/</a><br>




</div></div></div>
<br>_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br></blockquote></div><br><br clear="all"><br>-- <br>Ricardo Bittencourt<br><a href="http://www.ricbit.com">http://www.ricbit.com</a><br>