若有如下程序段: #include<iostream> using namespace std; int main () { char*p="abcdefgh",*r; r=p; cout<<*r<<end1; return 0; } 该程序的输出结果是( )。
A.a
B.b
C.c
D.d
[单选题]若有如下程序:includeusing namespace std;int s=0;class sample{static int n;publi若有如下程序: #include<iostream> using namespace std; int s=0; class sample { static int n; public: sample(int i) { n=i; } static void add() { S+=n; } }; int sample::n=0; int main() {
[单选题]若有如下程序:includeusing namespace std;Class TestClass1{private:int a;public:T若有如下程序: #include<iostream> using namespace std; Class TestClass1 { private: int a; public: TestClassl(int i) { a=i; } void disp() { cout<<a<<“,”; } }; Class TestClass2 { private
[单选题]若有如下程序:includeusing namespace std;class TestClass{public:void who(){cout<若有如下程序: #include<iostream> using namespace std; class TestClass { public: void who(){cout<<“TestClass”<<endl;} }; class TestClassl:public TestClass { public: void who(){cout<<“T
[单选题]若有如下程序:includeusing namespace std;class A{public:A(int i,int j){a=i;b=j;}若有如下程序: #include<iostream> using namespace std; class A { public: A(int i,int j) { a=i; b=j; } void move(int x,int y) { a+=x; b+=y; } void show() { cout<<a<<","<<b<<end1; } pr
[单选题]若有如下程序:includeusing namespace std;class TestClass{public:void who() {cout若有如下程序: #include<iostream> using namespace std; class TestClass { public: void who() {cout<<"TestClass"<<endl;} }; class TestClass1:public TestClass { public: void who(){cout<
[单选题]若有以下程序段;includeusing namespace std;int main(){ int a[]={1,4,5}; int *p=&若有以下程序段; #include<iostream> using namespace std; int main() { int a[]={1,4,5}; int *p=&a[0],x=6,y,z; for(y=0;y<3;y++) z=((*(p+y)<x) ? *(p+y):x); cout<<z<<end1; return 0; } 程序
[单选题]有如下程序:#includeusing namespace std;int main(){void function(double val);double val;function(val);cout<return 0;}void function(double val){val = 3;}编译运行这个程序将出现的情况是A. .编译出错,无法运行B. .输出: 3C. .输出: 3.0D. .输出一个不确定的数
[单选题]有如下程序:includeusing namespace std;int main(){int *p;*p=9;cout<<"The value a有如下程序: #include<iostream> using namespace std; int main() { int *p; *p=9; cout<<"The value at p:"<<*p; return 0; } 编译运行程序将出现的情况是( )A.编译时出现语法错误,不能生成可执行文件B.运行时一定输出:The value a
[单选题]有如下程序:includeusing namespace std;int main(){cout.fill('*');cout.width(6);c有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*'); cout.width(6); cout.fill('#'); cout<<888<<end1; return 0; } 的执行结果是( )。A.###888B.888###C. ***88
[单选题]有如下程序:includeusing namespace std;int i=1;class Fun{public:static int i;int有如下程序: #include<iostream> using namespace std; int i=1; class Fun { public: static int i; int value(){return i-1;} int value()const{return i+1;} }; int Fun::i=2; int main() { i