正确答案
structContact
{
publicstringname;
publicintage;
publicstringtelephone;
}
classProgram
{
staticvoidMain(string[]args)
{
Contact[]c=newContact[3];
//c[0]=newContact();//此三个语句,对于结构类型可以不用
//c[1]=newContact();
//c[2]=newContact();
c[0].name='刘龙';
c[0].age=54;
c[0].telephone='13970861234';
c[1].name='王鸣';
c[1].age=42;
c[1].telephone='13813254321';
c[2].name='张星';
c[2].age=39;
c[2].telephone='13751461818';
Console.Write('姓名:{0},',c[0].name);
Console.Write('年龄:{0},',c[0].age);
Console.WriteLine('手机号码:{0}',c[0].telephone);
Console.Write('姓名:{0},',c[1].name);
Console.Write('年龄:{0},',c[1].age);
Console.WriteLine('手机号码:{0}',c[1].telephone);
Console.Write('姓名:{0},',c[2].name);
Console.Write('年龄:{0},',c[2].age);
Console.WriteLine('手机号码:{0}',c[2].telephone);
试题解析