这是完成除a e i o u 变量处理的操作
static void Main(string[] args)
{
string myName,itName,themName;
int a=0,e=0,i=0,o=0,u=0.result=0;
Console.WriteLine ("请以拼音的形式输入你的名字,如张三:zhangsan");
myName=Console.ReadLine();
Console.WriteLine ("请以拼音的形式输入他(她)的名字,如张三:zhangsan");
itName=Console.ReadLine();
Console.WriteLine ("{0},{1}",myName,itName);
themName=myName+itName;
Console.WriteLine ("{0}",themName);
themName=themName.ToLower ();
char[]nameChars=themName.ToCharArray();
foreach(char character in nameChars)
{
if(character=='a')
{
a+=1;
}
else if(character=='e')
{
e+=1;
}
else if(character=='i')
{
i+=1;
}
else if(character=='o')
{
o+=1;
}
else if(character=='u')
{
u+=1;
}
}