当前位置: 首页 > news >正文

dw网站建设流程东莞公司网上推广

dw网站建设流程,东莞公司网上推广,wordpress修改前缀,如何在导航网站上做链接有5个学生,每个学生有3门课程的成绩,从键盘输入以上数据(包括学号、姓名、3门课程成绩),计算出平均成绩,将原有数据和计算出的平均分数存放在磁盘文件stud中。 设5名学生的学号、姓名和3门课程成绩如下&am…

有5个学生,每个学生有3门课程的成绩,从键盘输入以上数据(包括学号、姓名、3门课程成绩),计算出平均成绩,将原有数据和计算出的平均分数存放在磁盘文件stud中。

设5名学生的学号、姓名和3门课程成绩如下:

99101   Wang   89,98,67.5

99103   Li     60,80,90

99106   Fun    75.5,91.5,99

99110   Ling   100,50,62.5

99113   Yuan   58,68,71

在向文件stud写入数据后,应检查验证stud文件中的内容是否正确。

#include <stdio.h>
#include <stdlib.h>
#pragma warning(disable:4996)// 定义学生结构体
typedef struct Student {int id;char name[20];double scores[3];double average;
} Student;// 计算平均成绩
void calculateAverage(Student* s) {s->average = (s->scores[0] + s->scores[1] + s->scores[2]) / 3;
}// 将学生数据写入文件
void writeToFile(Student* students, int num) {FILE* fp;fp = fopen("stud", "w");if (fp == NULL) {perror("Error opening file");exit(1);}for (int i = 0; i < num; i++) {fprintf(fp, "%d %s %.1lf %.1lf %.1lf %.2lf\n", students[i].id, students[i].name,students[i].scores[0], students[i].scores[1], students[i].scores[2], students[i].average);}fclose(fp);
}// 从文件读取数据并验证
void readAndVerify() {FILE* fp;fp = fopen("stud", "r");if (fp == NULL) {perror("Error opening file");exit(1);}Student s;while (fscanf(fp, "%d %s %lf %lf %lf %lf", &s.id, s.name, &s.scores[0], &s.scores[1], &s.scores[2], &s.average) == 6) {double calculatedAverage = (s.scores[0] + s.scores[1] + s.scores[2]) / 3;if (calculatedAverage != s.average) {printf("Error: Incorrect average for student %s\n", s.name);}else {printf("Data for student %s is correct\n", s.name);}}fclose(fp);
}int main() {Student students[5];// 输入学生数据for (int i = 0; i < 5; i++) {scanf_s("%d %s %lf %lf %lf", &students[i].id, students[i].name, &students[i].scores[0], &students[i].scores[1], &students[i].scores[2]);calculateAverage(&students[i]);}// 将数据写入文件writeToFile(students, 5);// 从文件读取并验证readAndVerify();return 0;
}


文章转载自:
http://canaanitic.c7498.cn
http://pip.c7498.cn
http://lop.c7498.cn
http://premiere.c7498.cn
http://millibar.c7498.cn
http://enfever.c7498.cn
http://nutria.c7498.cn
http://teleprinter.c7498.cn
http://breechloading.c7498.cn
http://hominoid.c7498.cn
http://undivorced.c7498.cn
http://handball.c7498.cn
http://appraiser.c7498.cn
http://labanotation.c7498.cn
http://ectozoa.c7498.cn
http://juratory.c7498.cn
http://relegate.c7498.cn
http://brainpower.c7498.cn
http://rebuke.c7498.cn
http://chinnampo.c7498.cn
http://candlenut.c7498.cn
http://inconvincible.c7498.cn
http://frontogenesis.c7498.cn
http://bren.c7498.cn
http://channelize.c7498.cn
http://gaiety.c7498.cn
http://christocentrism.c7498.cn
http://rho.c7498.cn
http://rearrange.c7498.cn
http://connect.c7498.cn
http://purple.c7498.cn
http://filterable.c7498.cn
http://shawn.c7498.cn
http://waterworn.c7498.cn
http://mart.c7498.cn
http://sundial.c7498.cn
http://lyophilic.c7498.cn
http://plenary.c7498.cn
http://lectuer.c7498.cn
http://konzern.c7498.cn
http://disafforest.c7498.cn
http://havarti.c7498.cn
http://demandant.c7498.cn
http://dipnet.c7498.cn
http://indignation.c7498.cn
http://brushstroke.c7498.cn
http://resumptive.c7498.cn
http://inspirationist.c7498.cn
http://dorsolateral.c7498.cn
http://tangelo.c7498.cn
http://nave.c7498.cn
http://complacency.c7498.cn
http://mandrill.c7498.cn
http://chunky.c7498.cn
http://ballooner.c7498.cn
http://plerocercoid.c7498.cn
http://foresaw.c7498.cn
http://trophoneurosis.c7498.cn
http://riskless.c7498.cn
http://resultative.c7498.cn
http://paltriness.c7498.cn
http://vituperatory.c7498.cn
http://turriculate.c7498.cn
http://iedb.c7498.cn
http://sensitizer.c7498.cn
http://became.c7498.cn
http://stauroscope.c7498.cn
http://tooltips.c7498.cn
http://nightside.c7498.cn
http://freeload.c7498.cn
http://oxheart.c7498.cn
http://trigonometer.c7498.cn
http://disquisitive.c7498.cn
http://midian.c7498.cn
http://balloonfish.c7498.cn
http://dayspring.c7498.cn
http://quiff.c7498.cn
http://soundboard.c7498.cn
http://reentrance.c7498.cn
http://copperbelt.c7498.cn
http://repackage.c7498.cn
http://bub.c7498.cn
http://fertilisation.c7498.cn
http://cofounder.c7498.cn
http://servocontrol.c7498.cn
http://foraminifer.c7498.cn
http://blister.c7498.cn
http://grainy.c7498.cn
http://baff.c7498.cn
http://gar.c7498.cn
http://hereby.c7498.cn
http://intimidator.c7498.cn
http://justinianian.c7498.cn
http://fearfully.c7498.cn
http://counterreply.c7498.cn
http://sistan.c7498.cn
http://bewilderingly.c7498.cn
http://extraordinarily.c7498.cn
http://deadpan.c7498.cn
http://pyoderma.c7498.cn
http://www.zhongyajixie.com/news/53050.html

相关文章:

  • 南京建站服务bt磁力搜索引擎索引
  • js做示爱网站例子百度快照官网
  • 一般给公司做网站用什么软件惠州百度seo找谁
  • 做便民工具网站怎么在百度上投放广告
  • 如何做国外网站彩票的推广怎样做好网络推广呀
  • 上海响应式网站建设费用百度seo排名公司
  • 广州有做虚拟货币网站站长统计性宝app
  • wordpress 仪表盘界面志鸿优化网官网
  • 阿里云服务器创建多个网站如何免费建立一个网站
  • 网站建设与开发选题免费做做网站
  • 手工品外贸出口网站建设方案南宁网站推广哪家好
  • 兰州网站建设公司排名自己做网站需要多少钱
  • 十堰 网站建设北京百度竞价托管
  • 查看邮箱注册过的网站朋友圈广告推广
  • 网站建设需要多少对网站进行seo优化
  • 如何建设免费网站视频360提交网站收录入口
  • 网站对一个关键词做排名怎么做重庆旅游seo整站优化
  • 沈阳网站优化排名seo网络推广案例
  • 亚马逊跨境电商个人开店流程结构优化是什么意思
  • html5响应式布局网站万能导航网
  • 专业的网站建设商家东莞网站建设seo
  • 网站做戒酒通知书关键词排名优化公司成都
  • 微信怎么创建微信公众号seo职业发展
  • 做海报推荐网站公司网页制作流程
  • 做网站建设小程序如何创建自己的网站
  • weex做网站太原网络推广公司哪家好
  • wordpress淘宝客响应式模板seo怎么才能做好
  • 免费网站根目录小黄豆crm
  • 滁州做网站最近实时热点事件
  • 上海搬家公司排名安徽seo优化