#CS40104. 阅读程序-1模拟策略-4

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

阅读程序

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

第一节:模拟策略

第4题【NOIP】2012

#include <iostream>
using namespace std;
int a,b,c,d,e,ans;
int main(){
    cin>>a>>b>>c;
    d=a+b;
    e=b+c;
    ans=d+e;
    cout<<ans<<endl;
    return 0;    
}

●判断题

(1)当输入为“11 45 14”时,输出为“70”。 ( )

{{ select(4-1) }}

(2)输入的数都为负数时,输出可能为正数。 ( )

{{ select(4-2) }}

(3)输入的数都为正数时,输出可能为负数。 ( )

{{ select(4-3) }}

(4)将ans的类型改为char,输出结果不会改变。 ( )

{{ select(4-4) }}

●选择题

(5)输入为19 19 810时,输出为( )。

{{ select(4-5) }}

  • 867
  • 857
  • 967
  • 767

(6)输出为“28”时,输入可以为( )。

{{ select(4-6) }}

  • 5 8 7
  • 1 5 7
  • 1 1 25
  • 1 1 4