更多“语句cout<<setiosflagags(ios::showpos)<<125<<"/t"<<-125<<endl;的输出结果为【】。 ”相关问题
  • 第1题:

    5.以输出宽度为 8 输出变量 x 值的语句是()。

    A.(A)cout<<setw(8)<<x<<endl;

    B.(B)cout<<oct<<x<<endl;

    C.(C)cout<<setprecision(8)<<x<<endl;

    D.(D)cout<<setfill(8)<<x<<endl;


    cout<< setw(8)<< x<< endl;

  • 第2题:

    已知数组 arr 的定义如下: int arr[5] = {1,2,3,4,5}; 下列语句中输出结果不是3的是_______。

    A.cout << *arr+2 <<endl;

    B.cout << *(arr+2)<<endl;

    C.cout << arr[2] <<endl;

    D.cout << *arr <<endl;


    D D。【解析】本题主要考查指针的特殊含义。例*px+1指取px所指对象内容加1,*(px+1)指px指针加1,并取结果指针内容而*px则指px的首元素。

  • 第3题:

    已知数组arr的定义如下: int arr[5] = {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;


    D D。【解析】本题主要考查指针的特殊含义。例*px+1指取px所指对象内容加1,*(px+1)指px指针加1,并取结果指针内容而*px则指px的首元素。

  • 第4题:

    有语句 int a=1, b=2; 以下正确的输出语句是()。

    A.cout<<a=a+b<<endl;

    B.cout<<a>b?a:b<<endl;

    C.cout<<(hex)a+b;

    D.cout<<&a<<endl<<a<<endl;


    D

  • 第5题:

    已知数组arr的定义如下: int arr[5]={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;


    6个字节