我有来了
c#吧
全部回复
仅看楼主
level 5
KAOzhedoukeyi 楼主
class Program {
struct stu {
public int no;
public string name;
public string sex;
public int day;
public string add;
public int tp;
}
static void Main(string[] args)
{
stu[] s = new stu[2];
int i;
i = 0;
do
{
Console.Write("学号:");
s[i].no = Convert.ToInt32(Console.ReadLine());
Console.Write("姓名:");
s[i].name = Console.ReadLine();
Console.Write("性别:");
s[i].sex = Convert.ToString(Console.ReadLine());
Console.Write("生日:");
s[i].day = Convert.ToInt32(Console.ReadLine());
Console.Write("地址:");
s[i].add = Convert.ToString(Console.ReadLine());
Console.Write("电话:");
s[i].tp = Convert.ToInt32(Console.ReadLine());
i++;
} while (i < s.Length);
Console.WriteLine("\n---------------------\n");
Console.WriteLine(" 学号 姓名 性别 生日 地址 电话 ");
for (int j = 0; j < s.Length; j++)
{
Console.WriteLine("{0,6} {1,6} {2,6} {3,6} {4,6} {5,6} {6,6}", s[j].no, s[j].name, s[j].sex, s[j].day, s[j].add, s[j].tp);
}
Console.ReadKey();
}
}
}
----------------------------------
为什么没有显示啊 是在是发现不了哪里错了 求各位大神解答

2012年03月01日 07点03分 1
level 7
{6,6} 是什么
标题第二个字错了。
2012年03月01日 08点03分 2
level 5
KAOzhedoukeyi 楼主
电话 我发现标题打错了 telephone
2012年03月01日 10点03分 3
level 7
{0,6} -> s[j].no
{1,6} -> s[j].name
{2,6} -> s[j].sex
{3,6} -> s[j].day
{4,6} -> s[j].add
{5,6} -> s[j].tp
{6,6} -> ?
2012年03月02日 01点03分 4
level 5
KAOzhedoukeyi 楼主
恩 去掉了 调试好了 谢谢
2012年03月02日 01点03分 5
level 7
客气[抖胸]
2012年03月02日 01点03分 6
level 5
KAOzhedoukeyi 楼主
[揉脸] 免码了
2012年03月02日 01点03分 7
1