#include<iostream>
using std::cin;
using std::cout;
using std::endl;
inline double cube(const double side)
{return side*side*side;
}
int main()
{double sideValue;
cout<<"enter the side length:";
cin>>sideValue;
cout<<"the cube is"<<cube(sideValue)<<endl;
return 0;
}
结果:enter the side length: 3.5
the cube is 42.875