Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
string intToRoman(int num) {
string res;
char a[]={'I','X','C','M'};
char b[]={'V','L','D'};
int i=,ld=,n=;
while(i>=)
{
ld=num/n;
num%=n;
n/=; switch(ld)
{
case :break;
case :{res+=a[i];break;}
case :{res=res+a[i]+a[i];break;}
case :{res=res+a[i]+a[i]+a[i];break;}
case :{res=res+a[i]+b[i];break;}
case :{res=res+b[i];break;}
case :{res=res+b[i]+a[i];break;}
case :{res=res+b[i]+a[i]+a[i];break;}
case :{res=res+b[i]+a[i]+a[i]+a[i];break;}
case :{res=res+a[i]+a[i+];break;}
default :break; }
i--; }
return res; }