我该如何提供这个输出?给出的锥体体积 [英] How do I give this output? The volumee of cones as given

查看:52
本文介绍了我该如何提供这个输出?给出的锥体体积的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

h r = 1 r = 2 r = 3 r = 4 r = 5 r = 6 r = 7 r = 8 r = 9
1 1.05 4.19 9.42 16.76 26.18 37.70 51.31 67.02 84.82
2 2.09 8.38 18.85 33.51 52.36 75.40 102.63 134.04 169.65
3 3.14 12.57 28.27 50.27 78.54 113.10 153.94 201.06 254.47
4 4.19 16.76 37.70 67.02 104.72 150.80 205.25 268.08 339.29
5 5.24 20.94 47.12 83.78 130.90 188.50 256.56 335.10 424.12
6 6.28 25.13 56.55 100.53 157.08 226.19 307.88 402.12 508.94
7 7.33 29.32 65.97 117.29 183.26 263.89 359.19 469.14 593.76
8 8.38 33.51 75.40 134.04 209.44 301.59 410.50 536.17 678.58
9 9.42 37.70 84.82 150.80 235.62 339.29 461.81 603.19 763.41
10 10.47 41.89 94.25 167.55 261.80 376.99 513.13 670.21 848.23





我尝试了什么:



我试了很多但却得不到任何东西



What I have tried:

I tried so much but couldnt get anything

推荐答案

这是你的作业,所以没有代码!



但这很简单:

你需要tw o循环,一个在另一个内。

外循环用于高度h并递增1。

内循环用于半径r并且也增加1 。

在内循环内部,使用公式计算出当前h和r值的锥体体积

V =πr 2 h / 3

并使用printf打印它。

每次运行内循环之前,打印h的值。

每次运行内循环后,打印换行符。



所有你需要做的就是打印标题行,这是微不足道的!
This is your homework, so no code!

But it's pretty simple:
You need two loops, one within the other.
The outer loop is for the height h and increments by one.
The inner loop is for the radius r and also increments by one.
Inside the inner loop, work out the volume of of the cone for the current values of h and r using the formula
V=πr2h/3
And use printf to print it.
Before each run of the inner loop, print the value of h.
After each run of the inner loop, print a newline.

All you have to do then, is print the heading line, which is trivial!


这篇关于我该如何提供这个输出?给出的锥体体积的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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