填空题
以下程序的输出结果是
[11]
。 #include<iostream. h> void main() { int a[]= {1, 3, 5, 7}, *p=a, i; for (i=0; i<4: i++) a[i]=*p++; cout<<a[2]; }
【参考答案】
E
点击查看答案
<上一题
目录
下一题>
热门
试题
填空题
下列程序的运行结果是 [12] 。include <iostream. h>class Sample {int x,y;public:Sample() {x=y=0; }Sample(int a, int b) {x=a;y=b;}void disp() {cout<< x= <<x<< , y= <<y<<end1;}};void main() {Sample s1, s2(1, 2);s1. disp0;s2. disp ();}
点击查看答案&解析
填空题
以下程序的输出结果是 [8] 。#include <iostream. h>void main() {char *x[6] = { Would , you , like , C Plus Plus int i=0;while (i < 4){if (i==3)cout<<x[i]<< ;elsecout<<x[i]<< ;i++;}cout<<end1;
点击查看答案
相关试题
类的成员函数中,只能用于检测输入操作的函...
对于派生类的构造函数,在定义对象时构造函...
指出下面程序段中的错误,并说明出错原因 ...