计算平均值方差《计算机等级考试上机体分类9》(Calculate the mean variance, Computer Rank Examination on organism classification 9).docVIP
- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
计算平均值方差《计算机等级考试上机体分类9》(Calculate the mean variance, Computer Rank Examination on organism classification 9)
计算平均值方差《计算机等级考试上机体分类9》(Calculate the mean variance, Computer Rank Examination on organism classification 9)
32 please complete (RData) function, read 1000 decimal integer array to evennum from the IN.DET file, please write the function Compute (evennum) were calculated for a number of odd number odd, even even, the average value of ave1 odd, average value and variance of totfc even ave2 all even the value of. Finally, call the function WData () and export the result to the OUT.dat file.
The formula for calculating variance is as follows:
Where N is the even number, evennum[i] is even, and ave2 is an even number.
The format of the original data file is: each line stores 10 numbers (each number is greater than 0 and less than 2000), and is separated by commas.
Note: some programs have been given. Do not change the contents of the main function main () and the output data function WData ().
#include stdio.h
#include stdlib.h
#include string.h
#define MAX 1000
Int, evennum[MAX], odd = 0, even = 0;
Double, ave1 = 0, ave2 = 0, totfc = 0;
Void WData (void);
Int RData (void)
{FILE *fp;
Int, I, j;
If ((FP = fopen (IN.dat, R)) = = NULL)
Return 1;
For (i=0; i100; i++)
{for (j=0; j10; j++)
Fscanf (FP,%d, evennum[i*10+j]);
Fscanf (FP, \n);
If (feof (FP))
Break;
}
Fclose (FP);
Return 0;
}
Void Compute (void)
{
}
Void, main ()
{int i;
For (i=0; iMAX; i++)
Evennum[i] = 0;
If (RData ())
{printf (data file IN.dat cannot open \007\n!);
Return;
}
Compute ();
Printf (ODD=%d\nEVEN=%d\nAVE1=%f\nAVE2=%f\nTOTFC=%f\n, odd, even, ave1, ave2, totfc);
WData ();
}
Void WData (void)
{FILE *fp;
FP = fopen (OUT.dat, W);
Fprintf (FP,%d\n%d\n%f\n%f\n%f\n, odd, even, ave1, ave2, totfc);
Fclose (FP);
}
Void Compute (void)
{int, I, result[MAX];
For (i=0; i1000; i++)
If (evennum[i]%2)
{odd++;
Ave1 = evennum[i];
}
Else
{even++;
Ave2 = evennum[i];
Result[even-1] = evennum[i];
}
Ave1 / = odd;
Ave2 / = even;
For (i=0; ieven; i++)
Totfc = (result[i]-ave2) * (result[i]-ave2) /even;
}
70 function ReadDat () to
您可能关注的文档
- 第十一讲 计量基准、标准、溯源性(Eleventh, talking about measurement standards, standards and traceability).doc
- 第十七章 劳动力的价值或价格转化为工资(In the seventeenth chapter, the value or price of labor is translated into wages).doc
- 第十九章 量子物理(The nineteenth chapter quantum physics).doc
- 第十二章 血管内弥漫性凝血(The twelfth chapter is intravascular disseminated coagulation).doc
- 第十八章配送系统模式与配送策略(The eighteenth chapter is the distribution system model and distribution strategy).doc
- 第十四届中国国际高新技术成果交易会信息技术与产品展(The fourteenth China International hi tech fair information technology and products exhibition).doc
- 第十四章 抗原提呈细胞与抗原的处理及提呈(The fourteenth chapter deals with the treatment and presentation of antigen presenting cells and antigens).doc
- 第十章 使用文字工具(The tenth chapter uses text tools).doc
- 第十章 直线回归与相关(The tenth chapter is about linear regression and correlation).doc
- 第四届全国中学生数理化学科能力展示活动建模论文写作指导(The fourth national middle school students' mathematical chemistry ability demonstration activities writing guidance).doc
- 计算机221(Computer 221).doc
- 计算机2级公共基础120题(Computer 2 level public foundation 120 questions).doc
- 角色游戏培养孩子创造力(Role play developing children's creativity).doc
- 计算机三级上机考试-字符串(单词)的倒置和删除(Computer three level examination - string (word) inversion and deletion).doc
- 计算机专业英语词典网址大全(Computer English Dictionary).doc
- 计算机专业毕业的大学生们(Graduates majoring in Computer Science).doc
- 计算机二级考试1填空(Computer two test 1 fill in the blanks).doc
- 计算机信息系统集成资质等级评定条件(Qualification criteria for integration of computer information systems).doc
- 计算机初赛2007noip初赛基础知识(The preliminary 2007noip preliminary basic knowledge of computer).doc
- 计算机图形学的数学工具与C#实现(Mathematical tools for computer graphics and C# implementation).doc
文档评论(0)