填空题

以下程序段的执行结果为______。
#include <iostream.h>
#define PLUS(x,y) x+y
void main()

int x=1,y=2,z=3,sum;
sum=PLUS(x+y,z)*PLUS(y,z);
cout<<"SUM="<<sum;
cout<<endl;

【参考答案】

SUM=12
<上一题 目录 下一题>
热门 试题

填空题
有以下程序 #include <iostream> using namespace std; class Base int a; public: Base(int x)a=x; void show() cout<<a; ; class Derived: public Base int b; public: Derived(int i):Base(i+1),b(i) void show() cout<<b; ; int main() Base b(5),*pb; Derived d(1); pb=&d; pb->show(); return 0; 运行后的打印结果是______。
填空题
下列程序的运行结果是______。 #include <iostream.h> class A int a,b; public: A()a=b=0; A(int aa,int bb) a=aa; b=bb; cout<<a<<’’<<b<<endl; ; void main() A x,y(2,3),z(4,5);
相关试题
  • 如果有以下的函数定义及变量声明: void ...
  • 设有以下定义: class person int num...
  • 有如下程序: #include <iostream> u...
  • 在关系模型中,( )。
  • 下面描述中,符合结构化程序设计风格的是(...