for(int i=0;i<3;i++)
{cout< cout< 答:运行结果是 10,20 30,48 50,68 70,80 90,16 11,120 【3.19】 写出下面程序的运行结果。 #include using namespace std; class example { public: example(int n) { i=n; cout<<\ } ~example() { cout<<\ } int get_i() { return i; } private: int i; }; int sqr_it(example o) {return o.get_i()*o.get_i(); } int main() { example x(10); cout< 答:运行结果是 Constructing 10 Destructing 100 Destructing 【3.20】 写出下面程序的运行结果。 #include using namespace std; class aClass { public: aClass() {total++; } ~aClass() {total--; } int gettotal() { return total; } private: static int total; }; int aClass::total=0; int main() {aClass o1,o2,o3; cout< { cout<<\ return 1; } cout< cout<<\ delete p; cout< cout<<\ return 0; } 答:运行结果是 3 objects in existence 4 objects in existence after allocation 3 objects in existence after deletion 【3.21】 写出下面程序的运行结果。 #include using namespace std; class test { public: test(); ~test(){}; private: int i; }; test::test() { i=25; for(int ctr=0;ctr<10;ctr++) { cout<<\ } } test anObject; int main()