单项选择题
下列程序的输出结果是( )。
#include<iostream>
using namespace std;
int main()
char a[]="Hello,Test";
char *p=a;
while(*p)
if(*p>=’a’&&*p<=’z’)
cout<<char(*p+’A’-’a’);
else cout<<*p;
p++;
return 0;
A.hello,test
B.Hello,Test
C.HELLO,TEST
D.hELLO,tEST
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下程序: #include<iostream.h> using namespace std; class Demo public: Demo() cout<< default constructor n ; Demo(const Demo &X) cont<< copy constructor n ; ; Demo userCode (Demo b)Demo c(b);return c; int main() Demo a,d; cout<< calling userCode() n ; d=userCode(
A.;
&n
点击查看答案&解析
单项选择题
有下列的程序: #include<cstring.h> #include<iostream.h> using namespace std; class MyString public: MyString(const char*s); ~MyString()delete[]data; protected: unsigned len; char*data; ; MyString::MyString(const char*s) len=strlen(s); data=new char[len+1); strcpy(data,s); int main() MyString a( C++Programing ); MyString b(
A.;
return 0;
在运行上面的程
点击查看答案&解析
相关试题
下列程序的执行结果是( )。 #include...