单项选择题
以下程序的执行结果是( )。
#include<iostream.h>
#include<iomanip.h>
void fun(int n)
if(n!=0)
fun(n-1);
for(int i=1; i<=n; i++)
cout<<setw(3)<<i;
cout<<end1;
void main()
fun(3);
A.0
0 1
0 1 2
B.1
1 2
1 2 3
C.1
2 2
3 3 3
D.1
2
3
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
软件开发环境是全面支持软件开发全过程的______集合。
点击查看答案&解析
单项选择题
有以下程序,在横线应添加( )。 #include<iostream> using namespace std; class TestClass public: TestClass(int n)number=n; ______∥拷贝构造函数 ~TestClass() private: int number; : TestClass fun(TestClass P) TestClass temp(p); return temp; int main() TestClass obj1(10), obj2(0); TestClass obj3(obj1); obj2=fun(obj3); return 0;
A.TestClass(TestClass &other)number=other.number;
B.TestClass(TestClass other)number=other.number;
C.TestClass(TestClass &other)number;)
D.TestClass(&other)number=other.number;
点击查看答案&解析
相关试题
有如下类声明: class MyClass int i;...
若下面程序运行时输出结果为: 1,A,1...
下列函数的功能是判断字符串str是否对称,...
有如下程序: #include<iostream> usi...
以下程序的输出结果是______。 #in...