[单选题]

1)#include

2)using namespace std;

3)int main()

4){

5)int a,b,result;

6)cout<<"please input two numbers: ";

7)cin>>a>>b;

8)result=3*a-2*b+1;

9)cout<<"resultis" << result << endl;

10)} 

程序执行到第8行时,假设此时输入“4空格5”,则a的值是:()

A .0

B . 4

C . 5

D . 不确定

参考答案与解析:

相关试题

1)#include2)using namespace std;3)int ma

[试题]1)include2)using namespace std;3)int main()4){5)int a,b,result;6)couta>>b;8)result=3*a-2*b+1;9)cout<<"resultis"<< result<< endl;10)}程序的第5行中的cout表示:()A.显示字符串B.标准输出的流设备C.标准输入的流设备D.程序入口

  • 查看答案
  • 有以下程序:#include using namespace std;int m

    [单选题]有以下程序:include using namespace std;int main (){int x=15;while (x>10&&am有以下程序: #include <iostream> using namespace std; int main () { int x=15; while (x>10&&x<50) { x++; if (x/3) { x++; break; } } cout<<x<<endl; return 0; } 执行后的输出结果是A.15B.1

  • 查看答案
  • 有如下程序:#include using namespace std;int m

    [单选题]有如下程序:include using namespace std;int main( ){int*P;*P=9;cout<<"The value有如下程序: #include <iostream> using namespace std; int main( ){ int*P; *P=9; cout<<"The value at P:"<<*P: return 0; } 编译运行程序将出现的情况是A.编译时出现语法错误,不能生成可执行文件B.运行时一定输出:The value at P:

  • 查看答案
  • 有以下程序:#include using namespace std;int m

    [单选题]有以下程序:include using namespace std;int main ( ){ int n[3],i,j,k = 2; for(i有以下程序: #include <iostream> using namespace std; int main ( ) { int n[3],i,j,k = 2; for(i = 0;i<k;i++) n[i] = O; for(i = O;i<k;i++) { for(j = O;j<k;j++) n[j] = n[i] + 1; } cout<<

  • 查看答案
  • 有如下程序:#include using namespace std;int m

    [单选题]有如下程序:include using namespace std;int main(){ int *p; *p = 9;cout << "The有如下程序: #include <iostream> using namespace std; int main() { int *p; *p = 9; cout << "The value at p: " << *p; return 0; } 编译运行程序将出现的情况是( )。A.编译时出现语法错误,不能生成可执行文件B.运行时一定输出:The

  • 查看答案
  • 有如下程序: #include using namespace std; int

    [单选题]有如下程序: include using namespace std; int main() { cout.f有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*') cout.width(6); cout.fill('#') cout<<123<<endl; return 0; } 执行后的输出结果是A.###123B.123###C.***123D.123***

  • 查看答案
  • 有如下程序 #include using namespace std; int

    [单选题]有如下程序 include using namespace std; int i=1; class Fun {有如下程序 #include <iostream> using namespace std; int i=1; class Fun { public: static int i; int value( ){ return i-l;} int value( )const { return i+1;} }; int Fun::i=2; int main( ){ int i=3; Fun f

  • 查看答案
  • 有如下程序: #include using namespace std; int

    [单选题]有如下程序: include using namespace std; int main(){ int sum;有如下程序: #include<iostream> using namespace std; int main(){ int sum; for(int i=0;i<6;i+=3){ sum=i; for(int j=i;j<6;j++)sum+=j; } cout<<sum<<end1; return 0; } 运行时的输出结果是( )。A.3B.10C.12D.15

  • 查看答案
  • 有如下程序: #include using namespace std; int

    [单选题]有如下程序: include using namespace std; int main() { int *p;有如下程序: #include<iostream> using namespace std; int main() { int *p; *p=9; cout<<"The value at p:"<<*p; return 0; } 编译运行程序将出现的情况是A.编译时出现语法错误,不能生成可执行文件B.运行时一定输出:The value at p:9C.运行时一定输出:The val

  • 查看答案
  • 有如下程序: #include using namespace std; int

    [单选题]有如下程序: include using namespace std; int main() { void fu有如下程序: #include<iostream> using namespace std; int main() { void function(double val); double val; function(val); cout<<val; return 0; } void function(double val) { val=3; } 编译运行这个程序将出现的情况是A.编译出

  • 查看答案
  • 1)#include 2)using namespace std;3)int m