不知道你想干什么,先写一段代码,有什么疑问在说。
private string[] NUM = new string[] { "零", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "百" };
private void textBox1_TextChanged(object sender, EventArgs e)
{
int input = int.Parse(textBox1.Text==""?"0":textBox1.Text);
string label = "";
if (input >= 100)
{
label += NUM[(input % 1000) / 100] + NUM[11];
}
if (input >= 10 && input % 100 / 10 != 0)
{
label += NUM[(input % 100) / 10] + NUM[10];
}
else if (input >= 10 && input % 100 / 10 == 0 && input % 10 != 0)
{
label += NUM[0];
}
if (input == 0)
{
label = NUM[0];
}
else if (input % 10 != 0)
{
label += NUM[input % 10];
}
label1.Text = label;
}
温馨提示:答案为网友推荐,仅供参考