单项选择题

有以下程序:
#include <iostream>
using namespace std;
int main ( )
char s1[10],s2[10];
char *p=s1,*q=s2;
cin>>s1>>s2;
while (*p ! =’ \0 ’ )
p++;
while (*q!=’\0’)
*p++=*q++;
*p=’\0’;
cout<<s1<<end1;
return 0;

A.abcd0ghij
B.abcd0ghij0
C.abcd
D.abcdghij
<上一题 目录 下一题>
热门 试题

填空题
对于长度为n的线性表,若进行顺序查找,则时间复杂度为 【1】 。
单项选择题
对下列程序的描述中,正确的是( )。 #include<iostream> using namespace std; int Fun(int,int); int main() cout<<Fun(5,50)<<end1; return 0; int Fun(int x,int y) return x*x+y*y;
A.该函数定义正确,但函数调用方式错误
B.该函数调用方式正确,但函数定义错误
C.该函数的定义和调用方式都是正确的
D.该函数的定义和调用方式都是错误的
相关试题
  • 有如下的程序: #include <iostream>...
  • 以下程序运行后的输出结果是 【14】 。...
  • 经常和一个运算符连用,构成一个运算符函数...
  • 若有以下程序: #include <iostream>...
  • 在C++语言中,每个类都有一个隐含的指针...