c=[1]deffore():c.append(2)fore()print(c)输出结果是()A、[1,2]B、[1,2,3]C、[1,2,3,4]D、程序异常
c=[1]deffore():c.append(2)fore()print(c)输出结果是()
- A、[1,2]
- B、[1,2,3]
- C、[1,2,3,4]
- D、程序异常
相关考题:
若有以下程序段: int r=8; print("%d\n",r1): 输出结果是( )。 A.16B.8S 若有以下程序段: int r=8; print("%d\n",r1): 输出结果是( )。A.16B.8C.4D.2
有如下程序: include using namespace std; class TestClass { private: int x,y; pu 有如下程序: #include<iostream> using namespace std; class TestClass { private: int x,y; public: TestClass (int i,int j) { x=i; y=j; } void print() { cout<<"print1"<<end1; } void print()const { cout<<"print2"<<end1; } }; int main() { const TestClass a(1,2); a.print(); return 0; } 该程序运行后的输出结果是( )。A.print1B.print2C.print1 print2D.程序编译时出错
有如下程序: #includediostream usingnamespacestd; classTestClass {private: intX,y; public: TestClass(inti,intj) {x=i; y=j;} voidprint() {cout"printl"endl;} voidprint()const {cout"print2"endl;}}; intmain() {constTestClassa(1,2); print(); return0;} 该程序运行后的输出结果是( )。A.printlB.print2C.printlprint2D.程序编译时出错
有以下程序#includestdio.hstruct ord{int x,y;} dt[2]={1,2,3,4};main(){struct ord*p=dt;printf(“%d,”,++(p一x));printf(“%d\n”,++(p一y));}程序运行后的输出结果是A.1,2B.4,1C.3,4D.2.3
有以下程序: #includestdio.h struct ord {int X,y;)dt[2]={1,2,3,4}; main( ) { struct ord*p=dt; printf("%d,",++(p-x));printf("%d\n",++(p-y)); } 程序运行后的输出结果是( )。A.1,2B.4,1C.3,4D.2,3
有如下程序:#includediostreamusingnamespacestd;classTestClass{private:intX,y;public:TestClass(inti,intj){x=i;y=j;}voidprint(){coutprintlendl;}voidprint()const{coutprint2endl;}};intmain(){constTestClassa(1,2);print();return0;}该程序运行后的输出结果是( )。A.printlB.print2C.printlprint2D.程序编译时出错
(37)有以下程序#include stdio.hstruct ord{ int x,y;}dt[2]={1,2,3,4};main(){struct ord *p=dt;printf("%d,",++(p-x)); printf("%d\n",++(p-y));}程序运行后的输出结果是A)1,2B)4,1C)3,4D)2,3
单选题print({1,2,3}-{3,4,6})输出结果为:()A{-2,-2,-3}B{2,2,3}C{1,2}D报错