单项选择题

以下程序执行后的输出结果是 #include <iostream> using namespace std; void try(int,int,int,int); int main () { int x,y,z,r; x =1 ; y = 2; try(x,y,z,r); cout<<r<<endl; return 0; } void try(int x,int y,int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }

A.18
B.9
C.10
D.不确定
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序: #include <iostream> using namespace std; class sample { private: int n; public: sample(){} sample(int m) { n=m; } void addvalue(int m) { sample s; s.n=n+m; *this=s; } void disp () { cout<< n= <<n<<endl; } }; int main() { sample s(10); s.addvalue(5); s.disp(); return 0; } 程序运行后的输出结果是
A.n=10
B.n=5
C.n=15
D.n=20
单项选择题
要定义数组A,使得其中每个元素的数据依次为:3、9、4、8、0、0、0,错误的定义语句是
A.intA[]={3,9,4,8,0,0,0};
B.intA[9]={3,9,4,8,0,0,0};
C.intA[]={3,9,4,8};
D.intA[7]={3,9,4,8};
相关试题
  • 下面是复数类complex的定义,其中作为友元...
  • 有以下程序:#include <iostream>using...
  • 有以下程序#include <iostream>using ...
  • 有以下程序#include <iostream>using ...
  • 下列程序的输出结果是______。#incl...