Genere un programa que solicite al usuario un número romano e imprima este y por medio de una función lo convierta en su equivalente decimal y lo imprima también.
#include<stdio.h> #include<string.h> int convert(char r) { if (r == 'I') return 1; if (r == 'V') return 5; if (r == 'X') return 10; if (r == 'L') return 50; if (r == 'C') return 100; if (r == 'D') return 500; if (r == 'M') return 1000; return -1; } int romanToDecimal(string &str) { int res = 0; for (int i=0; i<str.length(); i++) { // Getting value of symbol s[i] int s1 = convert(str[i]); if (i+1 < str.length()) {