主题:方法怎样引用数组?????
using System;
public struct student
{
public string name;
public int age;
public string number;
}
public class fangfa
{
public void input ( student[] a,int n )
{
for(int i=0;i<n ;i++)
{
Console.WriteLine ("请输入第i学生的信息:",i+1);
Console.WriteLine ("姓名{0},年龄{1},学号{2}",a[i].name,a[i].age,a[i].name);
a[i].name =Console.ReadLine ();
a[i].age=int.Parse (Console.ReadLine ());
a[i].number=Console.ReadLine ();
}
}
}
class heihei
{
public static void Main()
{
(到这里该怎么写?)
}
}
public struct student
{
public string name;
public int age;
public string number;
}
public class fangfa
{
public void input ( student[] a,int n )
{
for(int i=0;i<n ;i++)
{
Console.WriteLine ("请输入第i学生的信息:",i+1);
Console.WriteLine ("姓名{0},年龄{1},学号{2}",a[i].name,a[i].age,a[i].name);
a[i].name =Console.ReadLine ();
a[i].age=int.Parse (Console.ReadLine ());
a[i].number=Console.ReadLine ();
}
}
}
class heihei
{
public static void Main()
{
(到这里该怎么写?)
}
}