December 17, 2018
Globular
Threads: Write a program to the radius of the sphere, calculate and print area, volume of the sphere which. Know the formula for calculating the area and volume respectively: S = 4πR^2 và V = (4/3)πR^3. Lay π = 3.14
Input: Some of the radius of the sphere.
Output: Two numbers separated by a space is the area and volume of a sphere, Results rounded to 2 decimal.
For example:
input: 4 output: 200.96 267.95
You are not logged in? Log in to Submit Now!
20 Comments
Add a Comment
You must be logged in to post a comment.
Hey Quan, what's wrong? 3 It gives an error that the input string is not in the correct format
1. Accepted
2. Accepted
Runtime Error (NZEC)
Is it ok now??
1. Accepted
2. Accepted
Runtime Error (NZEC)
I still have it .
This is due to your code. Error during running.
Radius can be integer or real.
Try changing your bk to real
in python i have no way to make yes 2 number 0 after the sign . who knows, hope everyone can teach me
Please try it here: https://thepythonguru.com/python-string-formatting/
Hey, it looks like something is wrong with the software. Every song I play, I get something like this 2,3,4,5 running…., the thing doesn't even appear 1
Hello, The system is under maintenance. Today will be back to normal. Thank you for responding.
The system is working again.
What is the final test in java?…. @@
Fictional huh?… yesterday put the formula in the last test error result. today change the formula outside and put it back in the variable @@
I don't understand where my volume formula is wrong, which kq is not correct with the output. Everyone give me your opinion
v = (4/3)*3.14*(r*r*r);
4/3=1.
I specialize in drilling for 40k, please give me class, oki??
No okay. Do you do it yourself?.
#include
#include
#include
int main () {
float r,V,S;
scanf(“%2.f”,&r);
S=r*r*3.14;
V=(4/3)*3.14*r*r*r;
printf(“%2.f %2.f”,S ,V);
}
where is wrong
it keeps coming out wrong asnswer
I look at the output of myself and the system to compare and know where is wrong.