- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
方差运算题(Variance algorithm)
方差运算题(Variance algorithm)
So were going to do 61.
Please write the function ReadDat () to read 1000 decimal integers from file in.dat to array xx. Please prepare the function to Compute () respectively calculate the xx in the even number even, odd number average ave1, even totfc ave2 and variance of the average value of the final function call WriteDat () to output the results to the OUT. The DAT file.
The formula for calculating variance is as follows:
N 2
Totfc = 1 / N ∑ (xx [I] - ave2)
I = 1,
The number of even Numbers, xx [I] is even, and ave2 is the average of even Numbers.
The original data file is stored in a format of 10 Numbers per row and separated by commas. (each number is greater than 0 and is less than or equal to 2000)
* * * * * * * * * * * * * * * * * * the * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
For (I = 0; I MAX; i++)
{fscanf (fp, % d, xx [I]);
If ((I + 1) % 10 = = 0)
The fscanf (fp, \ n); }
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
Void Compute (void)
{int I, yy (MAX);
For (I = 0; I MAX; i++)
Yy [I] = 0;
For (I = 0; I MAX; i++)
If (xx [I] % 2 = = 0) {yy [even++] = xx [I]; Ave2 + = xx [I]; }
The else {odd++; Ave1 + = xx [I]; }
If (odd = = 0) ave1 = 0;
The else ave1 / = odd;
If (even = = 0) ave2 = 0;
The else ave2 / = even;
For (I = 0; I even; i++)
[I] - ave2 totfc + = (yy) * (yy [I] - ave2)/even.
}
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Problem 62.
Please write the function ReadDat () to read 1000 decimal integers from file in.dat to array xx. Please prepare the function to Compute () respectively calculate the xx in the odd number of odd, odd number average ave1, ave2 and all the other odd even average variance totfc value, finally calling function WriteDat () to output the results to the OUT. The DAT file.
The fo
您可能关注的文档
- 天津南开中学部分杰出校友(Tianjin nankai middle school some outstanding alumni).doc
- 天津一中 初三数学(几何)试题(Tianjin elementary mathematics (geometry) test questions).doc
- 天语sx4配件价格一览(Sky language sx4 accessories price view).doc
- 天文观测(Astronomical observations).doc
- 天量法则……一种全新的股市实战法则(The law of the heavens... A new law of stock market practice).doc
- 天龙八部BOSS刷新一览表(The eight BOSS of tianlong refresh the list).doc
- 太阳能LED路灯智能控制系统电力控制与负载驱动(Power control and load drive of the intelligent control system of solar LED street lamp).doc
- 太阳能热水器培训资料(第一~四章)(Training materials for solar water heater (chapters 1-4)).doc
- 太阳能热利用课件-2(Solar thermal utilization courseware - 2).doc
- 太阳能知识1(Solar knowledge 1).doc
- 方德营销咨询,量身打造皖酒异地扩张模式(Fang DE marketing consultation, tailor the expansion mode of anhui wine).doc
- 施工图心得(Work drawing experience).doc
- 施工技术员在工地干嘛(What the construction technician is doing on the site).doc
- 日,本,动漫中英文对照表(Sun, Ben, comic books and English).doc
- 施工队一般工价参考(General price reference for construction team).doc
- 施工设计(Construction design).doc
- 日本企业介绍(Introduction of Japanese enterprises).doc
- 日本旅游地理(Japan tourism geography).doc
- 日本的几个著名风景区(Several famous scenic spots in Japan).doc
- 日本神话1(Japan myth 1).doc
最近下载
- 湖南省长沙市2025届高三新高考适应性考试语文试题及答案解析.pdf VIP
- 正方体的11种展开图--A4直接打印版.docx VIP
- 《商品学》(第2版)1-11章题库章节练习题答案全书测试题参考答案含原题.pdf VIP
- 23ZG210预应力高强混凝土空心方桩.pdf
- 心理咨询师考试发展心理学知识习题.docx VIP
- 02S515排水检查井图集 .docx VIP
- (高清版)DG∕TJ 08-2165-2015 建设项目交通影响评价技术标准.docx VIP
- 3.3.5患者参与医疗安全(达B档).doc VIP
- 道口开设施工合同5篇.docx VIP
- 九一八国旗下演讲稿《勿忘国耻吾辈自强》.docx VIP
文档评论(0)