题目内容

阅读下列程序,写出程序输出结果。#include using namespace std;class A{int a, b, c;public:A() { a=0; b=0; c=0; }A(int x, int y=2, int z=3) { a=x;b=y; c=z;}void Print( ) { cout<

查看答案
更多问题

阅读下列程序,写出程序输出结果。#include using namespace std;class A{int a;public:A(int x=0){a=x;cout<<"构造函数 A \n";}int get( ) { return a; }~A( ) { cout<<"析构函数 ~A \n";}};class B{int b;public:B(int x){b=x;cout<<"构造函数 B \n";}int get ( ) { return b; }~B( ) { cout<<"析构函数 ~B \n";}};class C{A a1, a2;B *p, b1;public:C(int x, int y, int z):b1(x), a1(y){cout<<"构造函数 C \n";p=new B(z);}void print( ){cout<get()<<'\t'<

根据注释要求,仔细阅读下列程序并完善程序。#include#includeusing namespace std;class String{char *str;public:String(char *s){____;// 为指针str申请动态内存strcpy(str,s);}~String( ) { ____; }// 释放动态内存void print( ) { cout<

下列程序中类STR的功能是统计字符串中的单词数量。请完善程序。#include#includeusing namespace std;class STR{char *p;int c;public:STR(char *s1=0){c=0;if (s1){p=____; // 初始化成员指针pstrcpy(p, s1);}elsep=0;}~STR( ) { if(p) ____; }void print( ){cout<

关于碘对比剂过敏试验,下列说法正确的是()

A. 推荐进行碘对比剂过敏试验
B. 阴性的患者不会发生过敏反应
C. 阳性的患者一定会发生过敏反应
D. 不同碘对比剂是否需要进行过敏试验参照医生经验
E. 阴性的患者也可能发生过敏样反应甚至严重过敏样反应

答案查题题库