以下程序段的输出结果是:char *p="abcdefgh";float *q=(float *)p;q++;cout<
A: b
B: bcdefgh
C: e
D: efgh
A: b
B: bcdefgh
C: e
D: efgh
举一反三
- 以下程序的输出结果是________ 。 main() { char *p="abcdefgh",*r; long *q; q=(long*)p; q++; r=(char*)q; printf("%s\n",r); }
- 以下程序段的运行结果是( )。[br][/br]char *p="abcdefgh",*r;[br][/br]long *q;[br][/br]q=(long *)p;[br][/br]q++;[br][/br]r=(char *) q;[br][/br]printf("%s\n",r);
- 程序段“char*p=“abcdefgh”;p+=3;printf(“%s”,p);”的运行结果是( ) A: abc B: abcdefgh C: defgh D: efgh
- 有以下程序: #include <iostream> #include <cmath> using namespace std; class Distance; class point { public: friend class Distance; Point(int a,int B) { x=a; Y=b; } void Print() { cout<<"X= "<<X<<end1; cout<<"Y= "<<Y<<end1; } private: float X,Y; }; class Distance { public: float Dis(Point &p,Point &q); }; float Distance :: Dis(Point &p,Point &q) { float result; result=sqrt((p.X-q.X)*(p.X-q.X)+(p.Y-q.Y)*(p.Y-q.Y)); cout<<result<<end1; retUrn result; } int main() { Point p(10,10),q(10,30); Distance d; d.Dis(p,q); return 0; } 运行后的输出结果是( )。 A: 10 B: 30 C: 0 D: 20
- 下面程序段的运行结果是()注意输出结果的格式#includevoidmain(){char*p=”abcdefgh”;p+=3;printf("%s",p);}