#include <stdio.h>
#include <stdlib.h>
char* One2Nineteen[] = {"", "One", "Two", "Three", "Four", "Five", "Six",
"Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen",
"Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"};
char* Twenty2Ninety[] = {"", "", "Twenty", "Thirty", "Forty", "Fifty",
"Sixty", "Seventy", "Eighty", "Ninety"};
char* One_Nineteen(int x) {
return One2Nineteen[x < 20 ? x : x % 10];
}
char* Twenty_Ninety(int x) {
char* cp
= (char*)malloc(sizeof(char) * 32); sprintf(cp
, "%s%s", Twenty2Ninety
[x
/ 10], (x
% 10 == 0 || x
< 20) ? "" : "-"); return cp;
}
int main(void) {
char a[3];
printf("%s%s\n", Twenty_Ninety
(x
), One_Nineteen
(x
)); return EXIT_SUCCESS;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmNoYXIqIE9uZTJOaW5ldGVlbltdID0geyIiLCAiT25lIiwgIlR3byIsICJUaHJlZSIsICJGb3VyIiwgIkZpdmUiLCAiU2l4IiwKICAiU2V2ZW4iLCAiRWlnaHQiLCAiTmluZSIsICJUZW4iLCAiRWxldmVuIiwgIlR3ZWx2ZSIsICJUaGlydGVlbiIsCiAgIkZvdXJ0ZWVuIiwgIkZpZnRlZW4iLCAiU2l4dGVlbiIsICJTZXZlbnRlZW4iLCAiRWlnaHRlZW4iLCAiTmluZXRlZW4ifTsKCmNoYXIqIFR3ZW50eTJOaW5ldHlbXSA9IHsiIiwgIiIsICJUd2VudHkiLCAiVGhpcnR5IiwgIkZvcnR5IiwgIkZpZnR5IiwKICAiU2l4dHkiLCAiU2V2ZW50eSIsICJFaWdodHkiLCAiTmluZXR5In07CgpjaGFyKiBPbmVfTmluZXRlZW4oaW50IHgpIHsKICByZXR1cm4gT25lMk5pbmV0ZWVuW3ggPCAyMCA/IHggOiB4ICUgMTBdOwp9CgpjaGFyKiBUd2VudHlfTmluZXR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