- 1
- 0
- 约1.62千字
- 约 6页
- 2018-01-24 发布于浙江
- 举报
C实验六报告
#includeiostream.h
#includestdlib.h
#includetime.h
struct student
{
int id;
int engl;
int math;
int phi;
int scores;
int ?aver;
//int* pscores;
//int* paver;
};
void main()
{
int getallscores(student stu[]);
int getaver(student stu[]);
void sort(student stu[]);
void print(student stu[]);
int find(student stu[]);
srand(time(0));
int i;
?
student stu[30];
?
for(i=0;i30;i++)
{
stu[i].id=i+10213;
stu[i].engl=rand()1;
stu[i].math=rand()1;
stu[i].phi=rand()1;
}
getallscores(stu);
getaver(stu);
sort(stu);
print(stu);
find(stu);
}
int getallscores(student stu[])
{
for(int i=0;i30;i++)
{
stu[i].scores=
原创力文档

文档评论(0)