• 2022-06-12
    已知数组arr的定义如下:int arr[5]={1,2,3,4,5};下列语句中输出结果不是5的是( )。
    A: cout<<*(arr+4)<<endl;
    B: cout<<*(arr+1)+5<<endl;
    C: cout<<arr[4]<<endl;
    D: cout<<*arr+4<<endl;
  • B

    内容

    • 0

      以下程序段的输出结果是()。int x=10, y=10;cout&lt;&lt;x--&lt;&lt;&quot;, &quot;&lt;&lt;--y&lt;&lt;endl;? 9,10|10,9|10,10|9,9

    • 1

      下面代码正确的是? A: &lt;div v-for="a, i in arr"&gt;&lt;/div&gt; B: &lt;div v-for="(a, i) in arr"&gt;&lt;/div&gt; C: &lt;div v-for="a, i : arr"&gt;&lt;/div&gt; D: &lt;div v-for="(a, i) : arr"&gt;&lt;/div&gt;

    • 2

      已知数组art的定义如下: int arr&#91;5&#93;={1,2,3,4,5); 下列语句中输出结果不是2的是 A: cout<<*arr+1<<endl; B: cout<<*(arr+1)<<endl; C: cout<<arr[1]<<endl; D: cout<<*arr<<endl;

    • 3

      写出下面程序的运行结果。 #include &lt;iostream&gt; using namespace std; class Base { public: void Who( ){cout&lt;&lt;"class Base"&lt;&lt;endl;} }; class Derived1:public Base { public: void Who( ){cout&lt;&lt;"class Derived1"&lt;&lt;endl;} }; class Derived2:public Base { public: void Who( ){cout&lt;&lt;"class Derived2"&lt;&lt;endl;} }; int main( ) { Base obj1,*p; Derived1 obj2; Derived2 obj3; p=&amp; obj1; p-&gt;Who(); p=&amp; obj2; p-&gt;Who(); p=&amp; obj3; p-&gt;Who(); obj2.Who(); obj3.Who(); return 0; } ______ ______ ______ ______ ______

    • 4

      以下if语句语法正确的是( )。 A: if(x&gt;0) cout&lt;&lt;xelse cout&lt;&lt;--x; B: if(x&gt;0){ x=x+y; cout&lt;&lt;x; }else cout&lt;&lt;--x; C: if(x&gt;0){ x=x+y; cout&lt;&lt;x; };else cout&lt;&lt;--x; D: if(x&gt;0){ x=x+y; cout&lt;&lt;x };else cout&lt;&lt;--x;