指针,函数
#include <stdio.h>#define NUMBER 5
double gpa(int score); //一门课绩点分计算函数
double avg_gpa( ); //所有课程平均绩点分计算函数,补全该函数参数部分
void print_array( ); //数组每个元素打印函数,补全该函数参数部分
void scan_array( ); //数组每个元素读取函数,补全该函数参数部分
int main(void)
{
unsigned int scores[NUMBER] = { 0 };
unsigned int credits[NUMBER] = { 0 };
double avg_gpa_result = 0.0;
unsigned int NUMBER = 0;
unsigned int scores[NUMBER];
unsigned int credits[NUMBER];
double gpa_result[NUMBER];
printf("Please input all the scores!\n");
scan_array( ); //读取每门课的分数
printf("Your scores are ");
print_array( ); //将每门课的分数打印出来
printf("\nPlease input all the credits!\n");
scan_array( ); //读取每门课的对应的学分
printf("Your credits are ");
print_array( ); //将每门课的分数打印出来
//计算机一学期所有课程的平均绩点分,并输出
return 0;