-
Lenguaje
C
-
Descripción
Recibe un número arábigo y muestra su equivalencia en notación romana
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
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
#include <stdio.h>
#include <stdlib.h>
int main (void)
{
int numero;
printf ("Ingrese un n\243mero ar\240bigo: ");
scanf ("%d", &numero);
putchar ('\n');
switch ((numero/1000)%10)
{
case 1: printf ("M"); break;
case 2: printf ("MM"); break;
case 3: printf ("MMM"); break;
case 4: printf ("__\nIV"); break;
case 5: printf ("_\nV"); break;
case 6: printf ("__\nVI"); break;
case 7: printf ("___\nVII"); break;
case 8: printf ("____\nVIII"); break;
case 9: printf ("__\nIX"); break;
}
switch ((numero/100)%10)
{
case 1: printf ("C"); break;
case 2: printf ("CC"); break;
case 3: printf ("CCC"); break;
case 4: printf ("CD"); break;
case 5: printf ("D"); break;
case 6: printf ("DC"); break;
case 7: printf ("DCC"); break;
case 8: printf ("DCCC"); break;
case 9: printf ("CM"); break;
}
switch ((numero/10)%10)
{
case 1: printf ("X"); break;
case 2: printf ("XX"); break;
case 3: printf ("XXX"); break;
case 4: printf ("XL"); break;
case 5: printf ("L"); break;
case 6: printf ("LX"); break;
case 7: printf ("LXX"); break;
case 8: printf ("LXXX"); break;
case 9: printf ("XC"); break;
}
switch (numero%10)
{
case 1: printf ("I"); break;
case 2: printf ("II"); break;
case 3: printf ("III"); break;
case 4: printf ("IV"); break;
case 5: printf ("V"); break;
case 6: printf ("VI"); break;
case 7: printf ("VII"); break;
case 8: printf ("VIII"); break;
case 9: printf ("IX"); break;
}
printf ("\n\n");
system ("pause");
return EXIT_SUCCESS;
}
#include <stdlib.h>
int main (void)
{
int numero;
printf ("Ingrese un n\243mero ar\240bigo: ");
scanf ("%d", &numero);
putchar ('\n');
switch ((numero/1000)%10)
{
case 1: printf ("M"); break;
case 2: printf ("MM"); break;
case 3: printf ("MMM"); break;
case 4: printf ("__\nIV"); break;
case 5: printf ("_\nV"); break;
case 6: printf ("__\nVI"); break;
case 7: printf ("___\nVII"); break;
case 8: printf ("____\nVIII"); break;
case 9: printf ("__\nIX"); break;
}
switch ((numero/100)%10)
{
case 1: printf ("C"); break;
case 2: printf ("CC"); break;
case 3: printf ("CCC"); break;
case 4: printf ("CD"); break;
case 5: printf ("D"); break;
case 6: printf ("DC"); break;
case 7: printf ("DCC"); break;
case 8: printf ("DCCC"); break;
case 9: printf ("CM"); break;
}
switch ((numero/10)%10)
{
case 1: printf ("X"); break;
case 2: printf ("XX"); break;
case 3: printf ("XXX"); break;
case 4: printf ("XL"); break;
case 5: printf ("L"); break;
case 6: printf ("LX"); break;
case 7: printf ("LXX"); break;
case 8: printf ("LXXX"); break;
case 9: printf ("XC"); break;
}
switch (numero%10)
{
case 1: printf ("I"); break;
case 2: printf ("II"); break;
case 3: printf ("III"); break;
case 4: printf ("IV"); break;
case 5: printf ("V"); break;
case 6: printf ("VI"); break;
case 7: printf ("VII"); break;
case 8: printf ("VIII"); break;
case 9: printf ("IX"); break;
}
printf ("\n\n");
system ("pause");
return EXIT_SUCCESS;
}