#include <stdio.h>
#include <string.h>
void f(int n)
{
char *nums[] = {"", "一", "二", "三", "四", "五", "六", "七", "八", "九"};
char *uni1[] = {"", "十", "百", "千"};
char *uni2[] = {"", "万", "億", "兆", "京", "垓", "秭", "穰", "溝", "澗", "正", "載", "極", "恒河沙", "阿僧祇", "那由他", "不可思議", "無量大数"};
char *b[256];
int k = 0;
int i = 0;
for (int m = n; m > 0; m = m / 10000)
{
int o = m % 10000;
if (o > 0)
{
b[k++] = uni2[i];
}
int j = 0;
for (; o > 0; o = o / 10)
{
int p = o % 10;
if (p > 0)
{
b[k++] = uni1[j];
}
if ((p > 1) || (j == 0))
{
b[k++] = nums[p];
}
j = j + 1;
}
i = i + 1;
}
char r[256] = {0};
for (int l = k - 1; l >= 0; l--)
{
}
}
int main(void)
{
f(1);
f(12);
f(123);
f(1234);
f(12345);
f(123456);
f(1234567);
f(12345678);
f(123456789);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCnZvaWQgZihpbnQgbikKewogICAgY2hhciAqbnVtc1tdID0geyIiLCAi5LiAIiwgIuS6jCIsICLkuIkiLCAi5ZubIiwgIuS6lCIsICLlha0iLCAi5LiDIiwgIuWFqyIsICLkuZ0ifTsKCWNoYXIgKnVuaTFbXSA9IHsiIiwgIuWNgSIsICLnmb4iLCAi5Y2DIn07CgljaGFyICp1bmkyW10gPSB7IiIsICLkuIciLCAi5YSEIiwgIuWFhiIsICLkuqwiLCAi5Z6TIiwgIuenrSIsICLnqbAiLCAi5rqdIiwgIua+lyIsICLmraMiLCAi6LyJIiwgIualtSIsICLmgZLmsrPmspkiLCAi6Zi/5YOn56WHIiwgIumCo+eUseS7liIsICLkuI3lj6/mgJ3orbAiLCAi54Sh6YeP5aSn5pWwIn07CgljaGFyICpiWzI1Nl07CglpbnQgayA9IDA7CglpbnQgaSA9IDA7CgoJZm9yIChpbnQgbSA9IG47IG0gPiAwOyBtID0gbSAvIDEwMDAwKQoJ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