char * intToRoman(int num){
int symInt[13]={1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1};
char *symStr[13]={"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"};
int tmp, i;
char *res=malloc(1000);
memset (res, 0, 1000);
char *p = res;
//while (num) {
for (i=0;i<13;++i) {
tmp = num/symInt[i];
while (tmp--){
memcpy(p, symStr[i], strlen(symStr[i]));
p += strlen(symStr[i]);
}
num = num % symInt[i];
}
//}
return res;
}