2个回答
展开全部
#include<stdio.h>
#define NUMBER 5
double avg_gpa(int scores[], int credits[], double gpa_result[]);
void print_array(int p[]);
void scan_array(int p[]);
int main(void)
{
unsigned int socres[NUMBER];
unsigned int credits[NUMBER];
double gpa_result[NUMBER];
int i=0;
printf("Please input all the scores!\n");
scan_array(socres);// 读取没门课的分数
printf("Your scoures are ");
print_array(socres); // 将每门课的分数打印出来
pringf("\nPlease input all the credits!\' ");
scan_array(credits); // 读取每门课对应的学分
printf("our credits are ");
print_array(credits); // 将每门课的分数打印出来
// 计算机一学期所有课程的平均绩点分
avg_gpa(socres, credits, gpa_result);
for(i=0; i<NUMBER; i++){
printf("%lf", gpa_result[i]);
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询