#include<iostream>
using namespace std;
#define PI 3.1416
#define AREA(R) PI*R*R
#deifne CUBE(X) ((X)*(X)*(X))
double Area(double r)
{
double t;
const double pi=3.1416;
t=pi*r*r;
return t;
}
double Cube(double s)
{
double q;
q=s*s*s;
return q;
}
int main()
{
cout<<"AREA(R)="<<AREA(3)<<endl;
cout<<"Area(r)="<<Area(3)<<endl;
int height=100;
cout<<"CUBE(X)="<<CUBE(height++)<<endl;
cout<<"height="<<height<<endl;
height=10;
cout<<"Cube(s)="<<Cube(height++)<<endl;
cout<<"height="<<height<<endl;
return 0;
}
为什么上述代码height两次输出不一样;
第一次height输出为103,第二次为11
posted on 2011-06-01 20:44
DoubleW 阅读(480)
评论(3) 编辑 收藏 引用