统计每一学生的平均成绩
已知文件中存有10 个学生的数学、政治、和英语三门课的成绩,试统计每一学生的平均成绩,并存入该文件中。
解:#include
struct student{ int number;
char cname[10];
int shuxue;
int zhengzhi;
int yingyu;
double ave;};
main()
{
FILE *fp;
struct student s[10];
int size;
int i;
size=sizeof(struct student);
if((fp=fopen(“student”,”ab+”))==NULL)
{
printf(“cannot open the file!”);
exit(0);
}
for(i=0;i
解:#include
struct student{ int number;
char cname[10];
int shuxue;
int zhengzhi;
int yingyu;
double ave;};
main()
{
FILE *fp;
struct student s[10];
int size;
int i;
size=sizeof(struct student);
if((fp=fopen(“student”,”ab+”))==NULL)
{
printf(“cannot open the file!”);
exit(0);
}
for(i=0;i
【统计每一学生的平均成绩】相关文章
1. 统计每一学生的平均成绩
3. 写给每一位新入职的朋友
4. 大一学生的职业生涯规划书
7. 面试成绩评价
9. 你的学习成绩如何?
10. 大一学生职业生涯规划
本文来源:https://www.mianshiwenti.com/a13095.html
进入下载页面
上一篇:经典C++面试题一
下一篇:编写strcpy函数