验证 const
#include
usingnamespace std;
int main()
{
constfloat PI =3.14;
PI =3;//尝试修改 PI 的值,将会出现错误提示。
float radius =10.0;
float area = PI * radius * radius;
float circumference =2* PI * radius;
cout <<"area is "<<area <<", circumference is "<< circumference<<endl;
return0;
}