- 297
- 0
- 约6.67千字
- 约 19页
- 2017-10-06 发布于河南
- 举报
广工anyview试题答案(广工anyview试题答案)
广工anyview试题答案(广工anyview试题答案)
/**********
[problem 9.023] struct type defined as follows:
Struct date{int year; int month; int day;}; / / define the date structure type
Struct student
{char name[20];
Struct date birth; / / date of birth
};
The struct array s stores the names of n individuals and the date of birth. Write a function that asks for the maximum age of the N individual
The name of the person who has the least date of birth.
**********/
Char *oldest (student, s[], int, n)
{int, J, k=0;
For (j=1; jn-1; j++)
{if (s[k].birth.years[j].birth.year) k=j;
Else if (s[k].birth.year==s[j].birth.year)
{if (s[k].birth.months[j].birth.month) k=j;
Else if (s[k].birth.month==s[j].birth.month)
If (s[k].birth.days[j].birth.day) k=j;
}
}
Return s[k].name;
}
/**********
[problem 9.033] the struct type of the date and list node is defined as follows:
Struct date{int year; int month; int day;}; / / date type of structure
The structure of struct / studentNode node list type
{char name[10]; / / name
Struct date birth; / / date of birth
Struct studentNode *next;
};
The struct list L stores the name and date of birth of n. Write a function, ask this n individual
The name of the oldest (ie the minimum date of birth).
**********/
Char *oldest (struct, studentNode, *L)
/ * if L is an empty table, or a null pointer null
Otherwise, return the name of the oldest person in the table
* /
{struct, studentNode, *p;
If (L==NULL) return NULL;
For (p=L-next; p; =NULL; p=p-next)
{
If ((*p).Birth.year (*L).Birth.year) continue;
If ((*p).Birth.year== (*L).Birth.year)
{
If ((*p).Birth.month (*L).Birth.month) continue;
If ((*p),.Birth.month== (*L),.Birth.month (*p),.Birth.day= (*L),.Birth.day) continue;
}
L=p;
}
Return ((*L).Name);
}
/**********
[problem 9.063] struct type defined as follows:
Struct course
{int cID; / / course number, value 0~99
Char name[10]; / / name of course
Float credit; / / credit value 0~5
Int semester; / / term value of 1~8
};
The structure array C stores information about th
您可能关注的文档
- 导基习题(Guide set exercises).doc
- 对粮食生产者直接补贴的初步思考(Preliminary thoughts on direct subsidies to grain producers).doc
- 导游必备基础知识(Basic knowledge of a tourist guide).doc
- 导游考试试题(Tour guide examination questions).doc
- 导游顺口溜(Tour guide jingle).doc
- 导电胶的应用和研究(Application and research of conductive adhesive).doc
- 寻找员工的最佳成长期(Looking for the best growth period for employees).doc
- 导线面积选择(Conductor area selection).doc
- 导致cpu超频失败原因(Causes CPU overclocking failure).doc
- 导游部的变化【业务经理和导游必看】(Changes in the Tour Department (business managers and guides must see it]).doc
原创力文档

文档评论(0)