如何在C中解决这个问题? [英] How to solve this question in C?

查看:96
本文介绍了如何在C中解决这个问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑一系列浮点数,xi,i = 1,2,...,m。平均值定义为:

关于均值的偏差是和标准差是
$ b $bxx1x2,,xm/ m
dixi-xi = 1,2,...,m
$ b $bsd2d2,,d2/(m1)12m


使用问题解决技术,即识别问题陈述,分析输入/输出描述,手动示例,算法开发(伪代码或流程图)以准备解决以下问题的解决方案问题。然后,写一个完整的C程序。



(i)从用户读取一个正整数作为m的值(需要验证m是正数但小于30 )。



(ii)读入一维浮点数组的m个元素(最多30个),计算这些元素的总和,平均值,偏差和标准偏差。



(iii)使用该程序处理以下数据:

27.5 13.4 53.8 29.2 74.5 87.0 39.9 47.7 8.1 63.2



我尝试过:



我尝试了一些简单的算法。但没有什么能正常工作

Consider a sequence of floating point numbers, xi , i = 1, 2, ..., m. The mean is defined as:
the deviation about the mean is and the standard deviation is
x  x1  x2 ,,xm / m
di  xi  x i = 1, 2, ..., m
s d2d2,,d2/(m1) 12m

Use the problem solving techniques, i.e. identify problem statement, analysing input/output description, hand example, algorithm development (pseudocode or flow chart) to prepare for the solutions that solve the following problem. Then, write a complete C program.

(i) Read a positive integer from user as the value of m (need to verify that m is positive but less than 30).

(ii) Read in the m elements (up to 30) of a one-dimensional floating point array, compute the sum of these elements, the mean, the deviation, and the standard deviation.

(iii) Use the program to process the following set of data:
27.5 13.4 53.8 29.2 74.5 87.0 39.9 47.7 8.1 63.2

What I have tried:

I have tries some simple algorithms. But nothing worked exactly

推荐答案

我们不做你的功课:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。

并且确定如何做到这一点是任务的一部分 - 事实上当我读到问题,这几乎是整个任务。



亲自尝试一下,你可能会发现它并不像你想象的那么难!



如果您遇到特定问题,请询问相关问题,我们会尽力提供帮助。但是我们不会为你做这一切!
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
And working out how to do it is part of the task - in fact as I read the question, it's pretty much the whole task.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!


我们不做你的HomeWork。

HomeWork不会测试你的技能在乞求其他人们做你的工作,它将帮助你的老师检查你对你所学课程的理解,以及你应用它们时遇到的问题。

你的任何失败都会帮助你的老师发现你的弱点并设定补救措施。

所以,开始工作吧。如果您遇到特定问题,请显示您的代码并解释这个问题,我们可以提供帮助。
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
So, start working. If you are stuck on a specific problem, show your code and explain this exact problem, we may help.


这篇关于如何在C中解决这个问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆