You are on page 1of 1

Algoritmo guia3_7

Escribir "Ingrese el numero a convertir"


Escribir "El numero debe ser entre 1000 y 2000"
Leer num
Si num >=1000 & num <= 2000 Entonces
Dimension nu[10], nd[10], nc[10],nm[9];
Definir nu,nd,nc,nm Como caracter;
nu[0]<-''; nu[1]<-'I'; nu[2]<-'II'; nu[3]<-'III'; nu[4]<-'IV';
nu[5]<-'V'; nu[6]<-'VI'; nu[7]<-'VII'; nu[8]<-'VIII'; nu[9]<-'IX';
nd[0]<-''; nd[1]<-'X'; nd[2]<-'XX'; nd[3]<-'XXX'; nd[4]<-'XL';
nd[5]<-'L'; nd[6]<-'LX'; nd[7]<-'LXX'; nd[8]<-'LXXX'; nd[9]<-'XC';
nc[0]<-''; nc[1]<-'C'; nc[2]<-'CC'; nc[3]<-'CCC'; nc[4]<-'CD';
nc[5]<-'D'; nc[6]<-'DC'; nc[7]<-'DCC'; nc[8]<-'DCCC'; nc[9]<-'CM';
nm[0]<-' ';nm[1]<-"M"; nm[2]<-"MM"; nm[3]<-"MMM";
nm[4]<-"[IV]"; nm[5]<-"[V]"; nm[6]<-"[VI]"; nm[7]<-"[VII]"; nm[8]<-"[VIII]";
Definir unidadesdemil,centenas,decenas,unidades como
numeros;
unidadesdemil<-trunc(num/1000) mod 10;
centenas<-trunc(num/100)mod 10;
decenas<-trunc(num/10)mod 10;
unidades<-num mod 10;
Limpiar Pantalla;
Escribir "";
Escribir "Usted Ingreso El Numero : ", num;
Escribir "";
Escribir "Convertido A Romano Es :" " "," ","
",nm[unidadesdemil],nc[centenas],nd[decenas],nu[unidades]
Sino
Escribir "el numero debe ser entre 1000 y 2000"
Fin Si
FinAlgoritmo

You might also like