-->
当前位置:首页 > 题库

PROGRAMMING:friend function

Luz5年前 (2021-05-10)题库428
The C + + exam is in progress. Please design a student class, whose student number and examination score are its private data members. At the same time, there is a friend function to calculate the average score of this examination
double average(student *p,int count)
The above class names and friend functions must be in accordance with the requirements of the title and cannot be modified.
The input is student number ([0000199999]) and grade, ending with 0( No more than 100 students)
The output is an average.
Input example:
10001 90
10002 93
0
Output example:
91.5






answer:If there is no answer, please comment