Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main(int argc, char *argv[]) {
- int n = 0, cnt = 0;
- char map[9][5] = {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"};
- char *dest = (char *) malloc(1024);
- scanf("%[^\n]dest", dest);
- n = strlen(dest);
- char *res = (char *) malloc(4 * n + 1);
- for (int i = 0; i < n; ++i) {
- strcpy(res + cnt, map[dest[i] - '0' - 1]);
- cnt += strlen(map[dest[i] - '0' - 1]);
- }
- printf("%s\n", res);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement