| Calculate the volume of the table |
| Difficulty level: A; running time limit: 1000 ms; running space limit: KB; code length limit: B |
| Question description |
| You can find the volume of the table by knowing the area of the bottom and the height of the table. Given the area and height of the upper and lower sides of the table are S1, S2, and h respectively, write a program to calculate and output the volume of the table. |
| Input |
| Three Positive floating point numbers separated by spaces in a row, representing S1, S2, and h, respectively. |
| Output |
| A row contains only one positive number, indicating the volume of the table. |
| Input example |
| 1107 16509 13619 |
| Output example |
| 9.93778e + 007 |
| Other Instructions |
| You can view the volume calculation formula of the table store. S1 and S2 represent the area of the Upper and Lower sides of the table store, and H represent the height of the table store, s1, S2, and H are floating point data input by the keyboard greater than zero. The program does not need to check whether the input data meets the requirements. |
This question uses a new operator, square:
sqrt();
Then I will go online to check the volume formula of the yutai --- I am lazy ----
The Code is as follows:
#include<iostream>#include<cmath>using namespace std;int main(){ double s1,s2,h; cin>>s1; cin>>s2; cin>>h; cout<
0019 --- calculate the volume of the table