一个星的半径帮助编写程序,需要更正吗? [英] radius of a star help writing program, need corrections?

查看:54
本文介绍了一个星的半径帮助编写程序,需要更正吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我想用一个使用pelles C来编写一个程序用于使用公式计算星的半径:


r = 1 / 2T ^ 2 * sqrt(L / pi *σ)


L = 3.36192 * 10 ^(140 - 2M / 5)

$ b $bσ= 5.67051 * 10 ^ -8


你被给予并且假设输入T和M的值来解决r,到目前为止我有这个但是我卡住了,我甚至不知道这是不对的:

hey im suppose to write a program using pelles C for windows to calculate the radius of the star using the formulas:

r = 1/2T^2 *sqrt( L/pi*σ)

L= 3.36192 *10^(140 - 2M/5)

σ = 5.67051*10^ -8

you are given and suppose to input the values for T and M to solve for r, so far I have this but im stuck and I dont even know if this is right:

展开 | 选择 | Wrap | 行号

推荐答案

代码中的注释:
Comments in code:
展开 < span class =codeDivider> | 选择 | Wrap | Line数字



代码中的注释:
Comments in code:
展开 | 选择 | Wrap | Li ne Numbers



我有点想知道如何将未知变量放入程序中。我给了T和M的值,不知怎的,我想把它们放到程序中来解决r。我不太确定如何将方程式放入程序中。我想放入T和M的值来解决r。这是我的主要问题。请帮忙。
I was kind of wondering how to put unknown variables into the program. I am given values for T and M and somehow im suppose to put them into the program to solve for r. Im not quite sure how to put the equations in the program. I am suppose to put in the values of T and M to solve for r. This is my main problem. Please Help.



如果我理解正确,你要么有用户输入变量,要么你有一个包含这些变量的文件,对吗? (以及哪一个?)

这个是一个页面,详细说明了您可以用来从用户和文件中获取输入的许多不同选项(尽管如果它在文件中,您可能需要进行更多挖掘 - 您可以googlec从文件读取输入,你应该得到一些东西,或者如果你找不到任何东西你可以回到这里。


这些看起来像你我想做什么,还是我想念你所说的?

If I understand you correctly, you either have a user inputting the variables, or you have a file with those variables, correct? (and which one?)

This is a page that details many different options you can use to get input from both the user and from a file (though you might have to do a little more digging if it is in a file - you can google "c read input from file" and you should get something, or you can post back here if you can''t find anything).

Do those look like what you''re trying to do, or did I miss what you were saying?


这篇关于一个星的半径帮助编写程序,需要更正吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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