作者:whiston潘_931 | 来源:互联网 | 2024-11-30 10:17
C#程序设计:
private void button1_Click(object sender, EventArgs e)
{
int[] array = new int[26];
for (int i = 0; i <26; i++)
array[i] = 0;
for (int i = 0; i {
if (textBox1.Text[i] >= 'a' && textBox1.Text[i] <= 'z')
{
array[(int)textBox1.Text[i] - 97]++;
}
}
for (int i = 0; i <26; i++)
textBox2.Text += ((char)(97 + i)).ToString() + ":" + array[i] + "\t";
}