#CS40102. 阅读程序-1模拟策略-2

阅读程序-1模拟策略-2

阅读程序

注意:切勿用电脑直接运行代码得出答案,请用大脑+笔+纸运行代码答题,否则是在浪费你的时间。

第一节:模拟策略

第2题【NOIP】2013

#include <iostream>

using namespace std;

int main()

{

    int a, b;

    cin >> a >> b;

    cout << a << "+" << b << "=" << a + b << endl;

}

●判断题

(1)当a,b为负数且(a+b)在int范围内,输出的等式在数学上也成立。

{{ select(2-1) }}

(2)当输入为0 0时,输出为0 + 0 = 0

{{ select(2-2) }}

(3)将03行的int改为signed程序不会出错。

{{ select(2-3) }}

(4)当输出为“-1+1=0”时候,输入可以为“2 -2”。

{{ select(2-4) }}

●选择题

(5)输入为“114514 1919810”时,输出为( )。

{{ select(2-5) }}

  • 114514+1919810=2034324
  • 114514+1919810=2034314
  • 114514+1919810=2024324
  • 114514+1919810=1034324

(6)时间复杂度为( )。

{{ select(2-6) }}

  • O((a+b)ln(a-b))
  • O(1)
  • O(abw)O(\frac{a^b}{w})
  • O(logba)O(\sqrt{{log}^ba})