//建立一个学生信息库
#include "iostream.h"
#include "string.h"
struct stu{int number;
char name[20];
char sex;
float score;
}s[6]={{1001,"zhengwei",'m',90.5},
{1002,"wangzhi",'w',89.0},
{1003,"zhaozho",'m',95.5},
{1004,"huanghong",'m',97.0},
{1005,"aike",'m',87.5},
{1006,"yahi",'w',78.0},
};
void main()
{int i=6,k,m,s1,temp;
float ss;
cout<<"欢迎进入学生信息库:"<
cout<<"1.输入新的人员"<
cout<<"2.查询人员"<
cout<<"3.成绩排队"<
cout<<"选择你要的服务:(1,2or3)"<
cin>>s1;
if(s1==1)
{for(k=i;;k++)
{cout<<"输入学生号码:"<
cin>>s[k].number;
for(m=0;m<=i;m++)
{if(s[m].number==s[k].number)
cout<<"输入同样的号码!<
s[k].number=0;
}
if(s[k].number==0)
{s[k].number=9;
break;
}
cout<<"输入学生名字"<
cin>>s[k].name;
cout<<"输入学生性别:"<
cin>>s[k].sex;
cout<<"输入学生分数"<
cin>>s[k].score;
}
}
if(s1==2)
{cout<<"输入你要查询的学生号码:"<
cin>>temp;
for(k=0;k<=5;k++)
{if(temp==s[k].number)
{cout<<"here is the student:"<
cout<<"s[k].name<<" "<
for(k=0;k<=5;k++)
{cout<<"No."<
}
}
}