axlxe_0171 Posted June 11, 2011 Report Share Posted June 11, 2011 wena cabros necesito ayuda con el programa sle tengo que hacer un pseudocodigo que el usuario ingrese un numero del 1 a 1000 y el programa le diga el nª que ingreso pero en romano...¬¬ y no tengo puta idea como hacerlo... si me pueden ayudar se los agradeceria. Link to comment Share on other sites More sharing options...
Aspro Posted June 11, 2011 Report Share Posted June 11, 2011 (edited) pedir numero() n=numero() i=0 while (i<1000) { if(n=='I'.x) imprimes que es romano else pedir numero() n= numero() i++; } algo haci se me ocurre rapidamente, quisas tenga algun error en el pseudocodigo pero ahi vez ojas te sirva en algo :banana: Edited June 11, 2011 by Aspro Link to comment Share on other sites More sharing options...
axlxe_0171 Posted June 13, 2011 Author Report Share Posted June 13, 2011 vale perrin .... = ya caxe como era es asi por si le sirve a alguien var num,col:numerico a:cadena inicio cls ( ) num = 0 go () imprimir ("ingrese un numero") leer (num) mientras (num >= 1000) {imprimir ("M") num = num - 1000} si (num >= 900) {imprimir ("CM") num = num - 900} si (num >= 500) {imprimir ("D") num = num - 500} mientras (num >= 100 ) {imprimir ("C") num = num - 100} si (num >= 90) {imprimir ("XC") num = num - 90} si (num >= 50) {imprimir ("L") num = num - 50} si (num >= 40) {imprimir ("XL") num = num - 40} mientras (num >= 10) {imprimir ("X") num = num - 10} si (num == 9) {imprimir ("IX") num = num - 9} si (num >= 5) {imprimir ("V") num = num - 5} si (num >= 4) {imprimir ("IV") num = num - 4} mientras (num > 0) {imprimir ("I") num = num - 1} fin Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now