kathy_yuki
Desconectado
Mensajes: 1
|
|
Bath
« Respuesta #6 en: 4 Julio 2010, 06:36 am » |
|
hola soy nueva, alguien me podria ayudar, necesito corregir este programa, no me funciona la funcion descendente y ascendente, necesito hacerla en if por fa.
@echo off
:menu cls echo, echo ________NUMEROS________ echo, echo 1.- Orden ascendente (los numeros no se deben repetir) echo 2.- Orden descendente (los numeros no se deben repetir) echo 3.- Numeros pares echo 4.- Numeros impares echo 5.- Creadores echo, set /p op=Opcion: echo, if %op%==1 goto ascendente if %op%==2 goto descendente if %op%==3 goto contador if %op%==4 goto contador if %op%==5 goto imprimir if %op% gtr 5 goto menu
:ascendente echo, set /p n1=ingrese numero: set /p n2=ingrese numero: set /p n3=ingrese numero: set /p n4=ingrese numero:
echo, if %n1% lss %n2% if %n2% lss %n3% if %n3% lss %n4% echo %n1%,%n2%,%n3%,%n4% if %n1% lss %n2% if %n2% lss %n4% if %n4% lss %n3% echo %n1%,%n2%,%n4%,%n3% if %n1% lss %n3% if %n3% lss %n2% if %n2% lss %n4% echo %n1%,%n3%,%n2%,%n4% if %n1% lss %n3% if %n3% lss %n4% if %n4% lss %n2% echo %n1%,%n3%,%n4%,%n2% if %n1% lss %n4% if %n4% lss %n3% if %n3% lss %n2% echo %n1%,%n4%,%n3%,%n2% if %n1% lss %n4% if %n4% lss %n2% if %n2% lss %n3% echo %n1%,%n4%,%n2%,%n3%
if %n2% lss %n1% if %n1% lss %n3% if %n3% lss %n4% echo %n2%,%n1%,%n3%,%n4% if %n2% lss %n1% if %n1% lss %n4% if %n4% lss %n3% echo %n2%,%n1%,%n4%,%n3% if %n2% lss %n3% if %n3% lss %n4% if %n4% lss %n1% echo %n2%,%n3%,%n4%,%n1% if %n2% lss %n3% if %n3% lss %n1% if %n1% lss %n4% echo %n2%,%n3%,%n1%,%n4% if %n2% lss %n4% if %n4% lss %n1% if %n1% lss %n3% echo %n2%,%n4%,%n1%,%n3% if %n2% lss %n4% if %n4% lss %n3% if %n3% lss %n1% echo %n2%,%n4%,%n3%,%n1%
if %n3% lss %n4% if %n4% lss %n1% if %n1% lss %n2% echo %n3%,%n4%,%n1%,%n2% if %n3% lss %n4% if %n4% lss %n2% if %n2% lss %n3% echo %n3%,%n4%,%n2%,%n1% if %n3% lss %n4% if %n4% lss %n1% if %n1% lss %n2% echo %n3%,%n1%,%n4%,%n2% if %n3% lss %n1% if %n1% lss %n2% if %n2% lss %n4% echo %n3%,%n1%,%n2%,%n4% if %n3% lss %n2% if %n2% lss %n4% if %n4% lss %n1% echo %n3%,%n2%,%n4%,%n1% if %n3% lss %n2% if %n2% lss %n1% if %n1% lss %n4% echo %n3%,%n2%,%n1%,%n4%
if %n4% lss %n3% if %n3% lss %n1% if %n1% lss %n2% echo %n4%,%n3%,%n1%,%n2% if %n4% lss %n2% if %n2% lss %n3% if %n3% lss %n1% echo %n4%,%n2%,%n3%,%n1% if %n4% lss %n2% if %n2% lss %n1% if %n1% lss %n3% echo %n4%,%n2%,%n1%,%n3% if %n4% lss %n1% if %n1% lss %n3% if %n3% lss %n2% echo %n4%,%n1%,%n3%,%n2% if %n4% lss %n1% if %n1% lss %n2% if %n2% lss %n3% echo %n4%,%n1%,%n2%,%n3% if %n4% lss %n3% if %n3% lss %n2% if %n2% lss %n1% echo %n4%,%n3%,%n2%,%n1%
:descendente echo, set /p n1=ingrese numero: set /p n2=ingrese numero: set /p n3=ingrese numero: set /p n4=ingrese numero: echo, echo, if %n1% geq %n2% if %n2% geq %n3% if %n3% geq %n4% echo %n1%,%n2%,%n3%,%n4% if %n1% geq %n2% if %n2% geq %n4% if %n4% geq %n3% echo %n1%,%n2%,%n4%,%n3% if %n1% geq %n3% if %n3% geq %n2% if %n2% geq %n4% echo %n1%,%n3%,%n2%,%n4% if %n1% geq %n3% if %n3% geq %n4% if %n4% geq %n2% echo %n1%,%n3%,%n4%,%n2% if %n1% geq %n4% if %n4% geq %n3% if %n3% geq %n2% echo %n1%,%n4%,%n3%,%n2% if %n1% geq %n4% if %n4% geq %n2% if %n2% geq %n3% echo %n1%,%n4%,%n2%,%n3%
if %n2% geq %n1% if %n1% geq %n3% if %n3% geq %n4% echo %n2%,%n1%,%n3%,%n4% if %n2% geq %n1% if %n1% geq %n4% if %n4% geq %n3% echo %n2%,%n1%,%n4%,%n3% if %n2% geq %n3% if %n3% geq %n4% if %n4% geq %n1% echo %n2%,%n3%,%n4%,%n1% if %n2% geq %n3% if %n3% geq %n1% if %n1% geq %n4% echo %n2%,%n3%,%n1%,%n4% if %n2% geq %n4% if %n4% geq %n1% if %n1% geq %n3% echo %n2%,%n4%,%n1%,%n3% if %n2% geq %n4% if %n4% geq %n3% if %n3% geq %n1% echo %n2%,%n4%,%n3%,%n1%
if %n3% geq %n4% if %n4% geq %n1% if %n1% geq %n2% echo %n3%,%n4%,%n1%,%n2% if %n3% geq %n4% if %n4% geq %n2% if %n2% geq %n3% echo %n3%,%n4%,%n2%,%n1% if %n3% geq %n4% if %n4% geq %n1% if %n1% geq %n2% echo %n3%,%n1%,%n4%,%n2% if %n3% geq %n1% if %n1% geq %n2% if %n2% geq %n4% echo %n3%,%n1%,%n2%,%n4% if %n3% geq %n2% if %n2% geq %n4% if %n4% geq %n1% echo %n3%,%n2%,%n4%,%n1% if %n3% geq %n2% if %n2% geq %n1% if %n1% geq %n4% echo %n3%,%n2%,%n1%,%n4%
if %n4% geq %n3% if %n3% geq %n1% if %n1% geq %n2% echo %n4%,%n3%,%n1%,%n2% if %n4% geq %n2% if %n2% geq %n3% if %n3% geq %n1% echo %n4%,%n2%,%n3%,%n1% if %n4% geq %n2% if %n2% geq %n1% if %n1% geq %n3% echo %n4%,%n2%,%n1%,%n3% if %n4% geq %n1% if %n1% geq %n3% if %n3% geq %n2% echo %n4%,%n1%,%n3%,%n2% if %n4% geq %n1% if %n1% geq %n2% if %n2% geq %n3% echo %n4%,%n1%,%n2%,%n3% if %n4% geq %n3% if %n3% geq %n2% if %n2% geq %n1% echo %n4%,%n3%,%n2%,%n1%
:contador echo, set /a contador=contador+1 if %contador% leq 4 goto parimpar if %contador% gtr 4 goto imprimir
:parimpar set /p num2=Ingrese Numero: set /a div=%num2%%%2 if %div% == 0 (set /a numpar=numpar+1) if %div% neq 0 (set /a numipar=numipar+1) goto contador
:imprimir cls echo, if %op% == 3 echo La cantidad de numeros pares es %numpar% if %op% == 4 echo La cantidad de numeros impares es %numipar% if %op% == 5 echo Creadoras: if %op% == 5 echo ___Katherinne if %op% == 5 echo ___Katherine pause>nul
|