下列程序的输出结果是( )。 class Test{ public static void main(String args[]){ int n=7: n<<=3; n=n&n+1|n+2^n+3; n>>=2: System.out.println(n); } )
A.0
B.-l
C.14
D.64
第1题:
有如下程序:#include <iostream>using namespace std:class Test{public: Test() {n+=2; ~Test() {n-=3; ; static int getNum() {return n;}privaue: static int n:};int Test::n=1;int main(){ Test* p=new Test; delete p; cout<<"n="<<Test::getNum()<<end1; return 0;} 执行后的输出结果是
A.n=0
B.n=1
C.n=2
D.n=3
第2题:
有如下程序: #include <iostream> using namespace std; class Test { public: Test() {n+=2;} ~Test() {n-=3;} static int getNum(){retum n;} private: static int n; }; int Test:: n=1; int main() { Test*p=new Test; delete p; cout<<"n="<<Test:: getNum()<<end1; return 0; };执行后的输出结果是______.
A.n=0
B.n=1
C.n=2
D.n=3
第3题:
第4题:
有如下程序: #include <iostream> using namespace std; class Test { public: Test() {n+=2; } ~Test() {n-=3; } static int getNum() {return n; } private: static int n; }; int Test::n=1; int main() { Test* p=new Test; delete p; cout<<"n="<<Test::getNum()<<endl; return 0; } 执行该程序的输出结果是( )。
A.n=0
B.n=1
C.n=2
D.n=3
第5题:
第6题:
下列程序的输出结果是()。 main(){ int k=4,m=5,n=7; int *pk=&k,*pm=&m,*p; *(p=&n)=*pk*(*pm); printf(“%d ”,n); }
A.5
B.7
C.20
D.21