2 喜歡 0 不喜歡
1.8k 瀏覽

Write a program that computes the volume of a sphere with a radius, using the formula v=(4.0/3.0)*r*r*r*3.141592 . Remember to keep the fraction 4.0/3.0 but not 4/3
The program should output 2 digits after decimal point.

寫一個計算球形體積程式,用這個公式v=(4.0/3.0)*r*r*r*3.141592。

分數寫法4.0/3.而不是4/3

Example input:

10

Example output:

4188.79
[練習] Coding (C) - 最新提問 分類:Chapter 2: C Fundamentals | 用戶: (12.1k 分)
ID: 25483 - 從幾時開始: 無限制 - 到幾時結束: 無限制

修改於 用戶: | 1.8k 瀏覽

50 個回答

0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>

int main()
{
***** ** * * ****** * * ** * r,v;
** ** *** * * ** * ** **** * * ** * **
** *** ** * * * *** ** * * ***
************ *** ** ** * ** * *** * * *
*** ** *** ***** ** * *** *** 0;
}
最新回答 用戶: (82 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 喜歡 0 不喜歡
內容已隱藏
* * **** ****

* * * ****** **
**** PI * ***
int main (){
float r,v;

* * ** * ** * * * * *
** * * * * * * **
*** **
******* * ** = ** ** * *

*** * 0;
}
最新回答 用戶: (16 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include * *** ** ***
#include <math.h>

#define PI 3.141592

int main(){
*** * ** ** ** * * ** r;
* ** ** * * * * * v;
* ** ** * ***** ****** * *
**** * *** ** * ** ** * * * **** * **
*** ******** * ** **
*** **** **** * * **** = (4.0/3.0)*r*r*r*PI;
*** ** * * * * *
** * * * * ** * * * **** *** * ** *** * * ** * **
** ** * *** * *** *
* * * ** ***** 0;
}
最新回答
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 喜歡 0 不喜歡
內容已隱藏
*** * * * * ** *
****** * * **
int r;
float v;
** * * ***** ** * *
* **** ** ***
** ** * * * *** ** ******* **** * *

return 0;
}
最新回答 用戶: (-32 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 喜歡 0 不喜歡
內容已隱藏
*** ****** * * *

int main()

{
* * ** * *** **** *** *** * r,pi,v;
** * *** ** *** * *** ** * ** ** ** ** \n");*/
    *** * ** *** *** ** * *
** * *** ** **** * * * * * *
** * * * ***** * * ** * * * ***** *** ***

}
最新回答 用戶: (-32 分)
修改於 用戶:
0 0
prog.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main()
 ^~~~
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 喜歡 0 不喜歡
內容已隱藏
* ** ** **** ***
int main()
{
* * ** ** **** *** ** r,v=0;
*** * *** ** * ** * ** ** * * * ***
* ** * * **** * * ** * *** * * * ** **** * * *
}
最新回答 用戶: (-214 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 喜歡 0 不喜歡
內容已隱藏
# include * ****** * **
# include * ** *

int main()
{
* **** * * ** *** r,volume;

* * *** ** * * ***** * ** ** * * * ***** ** * ** *

* * ** ***** * ******* ** ** ** ** * ** *

** * * ** ** * * ** ********* * * * ** * ** *

* *** ** * ** * ** * * 0;
}
最新回答 用戶: (-16 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>

int main()

{
* *** *** * ** *** ** *** rad,vol;
** ** ******* * * * * ** ** * ** * *** **

* * * * ****** * ** * ** ** **** *
** * * * ** ***** **** * ****** *** ** **
** * * ** *** **** * * 0;

}
最新回答 用戶: (-249 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 喜歡 0 不喜歡
內容已隱藏
* * ** *** * **
* ** *** * 4.0/3.0
* *** * * *** 3.14f
int main()
{
* * * ** * ***** *** * radius;
****** ** * ** * * *
*** **** * ** * ***** ** ** * ** ** * * * *
* * * * **** = **** radius * radius * radius * * *
* **** ** * ******* * * * * * * ** *
* ** * * * **** * * 0;


}
最新回答 用戶: (-167 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include * ***** *
int main ()
{
*** * * * * ** ** * ** * ** * r;
* *** *** * * ** * *** v;

* * * **** **** **** * * * * *** * & r);

** ** **** ** ** * ** = (4.0/3.0)* **** * *
* * ** ** * **** ** ** *** * ** v);

** ** **** ****** ******* * * 0;
}
最新回答 用戶: (-167 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.179.75
©2016-2024

相關問題

4 喜歡 1 不喜歡
61 回答
[練習] Coding (C) - 最新提問 9月 28, 2017 分類:Chapter 2: C Fundamentals | 用戶: thopd (12.1k 分)
ID: 25484 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 2k 瀏覽
1 喜歡 0 不喜歡
73 回答
[練習] Coding (C) - 最新提問 9月 28, 2017 分類:Chapter 2: C Fundamentals | 用戶: admin (9.9k 分)
ID: 25482 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 2.3k 瀏覽
12,783 問題
183,443 回答
172,219 留言
4,824 用戶