使用结构体实现求平均成绩
/*********************************
功能:使用结构体实现求平均成绩
日期:2014年12月10日10:47:03
************************************/
#include<stdio.h>
int main()
{
struct student_score
{
int mid;
int end;
int ave;
}score;
printf("Please input score (midterm and end of term):");
scanf("%d,%d",&score.mid, &score.end);
score.ave = (score.mid + score.end) / 2;
printf("average = %d\n", score.ave);
}
/**************************************************
Please input score (midterm and end of term):25,69
average = 47
Press any key to continue
****************************************************/