#542. 十五届蓝桥杯中高级组8月

十五届蓝桥杯中高级组8月

一.选择题

1.字符串常量“I love C++”占用的字节数是() {{ select(1) }}

  • 8
  • 9
  • 10
  • 11

2.下列运算符中,优先级最高的是() {{ select(2) }}

  • =
  • &&
  • !
  • %

3.已定义数组int a[100],以下赋值语句中引用数组元素正确的是( ) {{ select(3) }}

  • a[100] = 100
  • a['A'] = 'A'
  • a[A] = [A]
  • a[-1] = -1

4.二进制数1001001001转换成十进制是() {{ select(4) }}

  • 593
  • 585
  • 329
  • 330

5.运行下面程序,输出的结果是()

int n = 7, m = 1;
for (int i = 1; i <= n; i++)
{
    for(int j = 1; j < i; j++)
    {
        cout << '-';
    }
    for(int j = i; j <= n; j++)
    {
        if (i + j != n + 1)
            cout << 'O';
        else
            cout << '-';
        m++;
    }
    cout << endl;
}

{{ select(5) }}

  • image
  • image
  • image
  • image