sos pasar a romano
Publicado por cesar (44 intervenciones) el 07/12/2017 02:04:06
El error cuando le doy el numero no me lo pasa a numero romano el numero debe ser 2150 aqui tienen el link del video y el programa como yo lo hice
https://youtu.be/ZnGJxsTYudU?list=PLWtYZ2ejMVJlUu1rEHLC0i_oibctkl0Vh
https://youtu.be/ZnGJxsTYudU?list=PLWtYZ2ejMVJlUu1rEHLC0i_oibctkl0Vh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//video 9
//CURSO 2 Pasarun Numero a Romano
#include<iostream>
using namespace std;
int main(){
int numero, unidades, decenas,centenas, millar ;
cout <<"digite un numero "; cin>>numero;
unidades = numero%10; numero /= numero/10;
decenas = numero%10; numero /= 10;
centenas = numero%10; numero /= numero/10;
millar = numero%10; numero /= numero/10;
switch(millar){
case 1: cout <<"M"; break;
case 2:cout <<"MM"; break;
case 3: cout <<"MMM"; break;
}
switch(centenas){
case 1: cout <<"C"; break;
case 2:cout <<"CC"; break;
case 3 : cout <<"CCC"; break;
case 4: cout <<"CD"; break;
case 5: cout <<"D"; break;
case 6: cout <<"DC"; break;
case 7: cout <<"DCC"; break;
case 8: cout <<"DCCC"; break;
case 9 : cout <<"CM"; break;
}
switch(decenas){
case 1: cout <<"X"; break;
case 2: cout <<"XX"; break;
case 3: cout <<"XXX"; break;
case 4: cout <<"XL"; break;
case 5 : cout <<"L"; break;
case 6 : cout <<"LX"; break;
case 7: cout <<"LXX"; break;
case 8:cout <<"LXXX"; break;
case 9 : cout <<"XC"; break;
}
switch(unidades){
case 1: cout <<"I"; break;
case 2:cout <<"II"; break;
case 3: cout <<"III"; break;
case 4: cout <<"IV"; break;
case 5: cout <<"V"; break;
case 6 : cout <<"VI"; break;
case 7 : cout <<"VII"; break;
case 8: cout <<"VI"; break;
case 9 : cout <<"IX"; break;
}
return 0;
}
Valora esta pregunta


0