// 在宏使用括号 #include <iostream> using namespace std; #define CUBE(a) ( (a) * (a) * (a) ) #define THREE(a) a * a * a int main() { long x = 5; long y = CUBE(x); long z = THREE(x); cout << "y: " << y << endl; cout << "z: " << z << endl; long a = 5, b = 7; y = CUBE(a+b); z = THREE(a+b); cout << "y: " << y << endl; cout << "z: " << z << endl; return 0; }
by: 发表于:2018-02-01 09:50:32 顶(0) | 踩(0) 回复
??
回复评论