常量实例:已知半径,求圆的周长和面积。
#include
usingnamespace std;
#define PI 3.14
int main()
{
float radius =10.0;
float area = PI * radius * radius;
float circumference =2* PI * radius;
cout <<"area is "<<area <<", circumference is "<< circumference<<endl;
return0;
}