<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV>Hola que tal.</DIV>
<DIV> </DIV>
<DIV>Llevo ya horas con esto y estoy empezando a sentir ganas de romper algo; el
código que les pongo a continuación es para determinar en mayor y menor número
de toda la secuencia while que se repite indefinidamente hasta que introduzco el
caracter | el cual me corta el bucle y seguidamente me muestra un resumen de
número mayor y menor de todos los que le puse. Me funciona todo menos el número
menor.</DIV>
<DIV> </DIV>
<DIV>Parece fácil pero es increíble lo que puede complicarse, al menos para mi
<IMG class="wlEmoticon wlEmoticon-smile"
style="BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none"
alt=Sonrisa src="cid:61020E85840E48BF93E5993AF51CE5FF@MasterPC"></DIV>
<DIV> </DIV>
<DIV>Un saludo y gracias</DIV>
<DIV> </DIV>
<DIV>Les paso el código:</DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New">#include "std_lib_facilities.h"</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">int main()</FONT></DIV>
<DIV><FONT face="Courier New">{</FONT></DIV>
<DIV><FONT face="Courier New"> double uno, mayor, menor, suma,
metros;</FONT></DIV>
<DIV><FONT face="Courier New"> string que;</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> int cantidad;</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> cantidad = 0;</FONT></DIV>
<DIV><FONT face="Courier New"> suma = 0;</FONT></DIV>
<DIV><FONT face="Courier New"> mayor = 0;</FONT></DIV>
<DIV><FONT face="Courier New"> menor = 0;</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">
while(cin>>uno>>que)</FONT></DIV>
<DIV><FONT face="Courier New">
</FONT></DIV>
<DIV><FONT face="Courier New"> if(que == "cm")</FONT></DIV>
<DIV><FONT face="Courier New"> {</FONT></DIV>
<DIV><FONT face="Courier New"> metros
= uno / 100;</FONT></DIV>
<DIV><FONT face="Courier New"> que =
"m";</FONT></DIV>
<DIV><FONT face="Courier New"> cout
<< metros << que << endl;</FONT></DIV>
<DIV><FONT face="Courier New">
cantidad = cantidad + 1;</FONT></DIV>
<DIV><FONT face="Courier New"> suma =
suma + metros;</FONT></DIV>
<DIV><FONT
face="Courier New">
</FONT></DIV>
<DIV><FONT face="Courier New"> //menor
= uno</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> if(uno
> mayor)</FONT></DIV>
<DIV><FONT face="Courier New">
{</FONT></DIV>
<DIV><FONT
face="Courier New">
mayor = uno;</FONT></DIV>
<DIV><FONT face="Courier New">
}</FONT></DIV>
<DIV><FONT face="Courier New"> else
if(uno >= 0 || uno < menor)</FONT></DIV>
<DIV><FONT face="Courier New">
{</FONT></DIV>
<DIV><FONT
face="Courier New">
menor = uno;</FONT></DIV>
<DIV><FONT face="Courier New">
}</FONT></DIV>
<DIV><FONT face="Courier New"> }
</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> else if(que != "cm" || que !=
"m" || que != "ft")</FONT></DIV>
<DIV><FONT face="Courier New"> {</FONT></DIV>
<DIV><FONT face="Courier New"> cout
<< "no se reconoce medida" << endl;</FONT></DIV>
<DIV><FONT face="Courier New"> }</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> cout
<< "Mayor: " << mayor << "m" << endl;</FONT></DIV>
<DIV><FONT face="Courier New"> cout
<< "Menor: " << menor << "m" << endl;</FONT></DIV>
<DIV><FONT face="Courier New"> cout
<< "Cantidad: " << cantidad << endl;</FONT></DIV>
<DIV><FONT face="Courier New"> cout
<< "Suma: " << suma << "m" << endl;</FONT></DIV>
<DIV><FONT face="Courier New"> </FONT></DIV>
<DIV><FONT face="Courier New">
keep_window_open();</FONT></DIV>
<DIV><FONT face="Courier New">
keep_window_open();</FONT></DIV>
<DIV><FONT face="Courier New"> return 0;</FONT></DIV>
<DIV><FONT face="Courier New">}</FONT></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<META name=GENERATOR content="LibreOffice 3.4 (Win32)">
<META name=CREATED content=20111024;9105492>
<META name=CHANGED content=20111024;9124326>
<STYLE type=text/css>
<!--
@page { margin: 2cm }
p { margin-bottom: 0.21cm }
-->
</STYLE>
<P style="MARGIN-BOTTOM: 0cm"><BR><FONT color=#548dd4><FONT
face="Arial, sans-serif"><FONT size=2><I><B>Oscar Aparicio
Holgado</B></I></FONT></FONT></FONT><BR><FONT color=#e36c09><FONT
face="Tahoma, sans-serif"><FONT size=2>Administrador de
sistemas.</FONT></FONT></FONT></P></DIV></DIV></DIV></BODY></HTML>