#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 閱讀(494)
評(píng)論(3) 編輯 收藏 引用