网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

定义数组char s[10]={65,66,67,68,69};,则执行输出语句cout<<s<<endl;会显示:ABCDE。


参考答案和解析
D
更多 “定义数组char s[10]={65,66,67,68,69};,则执行输出语句cout<<s<<endl;会显示:ABCDE。” 相关考题
考题 以下程序的输出结果是【】。 include using namespace std; int main() {char S[]="abcde 以下程序的输出结果是【 】。include <iostream>using namespace std;int main(){char S[ ]="abcdef";s[3]='\0';cout<<s<<end1;return 0;}

考题 ( 20 )已知数组 arr 的定义如下:int arr[5] = {1,2,3,4,5};下列语句中输出结果不是 2 的是A ) cout *arr+1 endl;B ) cout *(arr+1)endl;C ) cout arr[1] endl;D ) cout *arr endl;

考题 若有定义和语句: char*sl="12345",* s2="1234"; printf("%d\n",strlen(stren(sl,s2))); 则输出结果 ( )A.4B.5C.9D.10

考题 下列程序时类D代码段出现编译错误,原因是【 】。 include class A { public:A(char c) 下列程序时类D代码段出现编译错误,原因是【 】。include<iostream. h>class A{public:A(char c){cout<<"A's constructor."<<c<<endl;}~A(){cout<<"A's destructor."<<endl;}};class B: virtual public A{public:B(char cb,char cd):A(cb) {cout<<"B's constructor."<<cd<<endl;}~B(){cout<<"B's destructor."<<endl;}private:char b;};class C:virtual public A{public:C(char cc, char cd):A(cc){cout<<"C's constructor. "<<cd<<endl;}~C(){cout<<"C's destructor."<<endl;}};class D:public B,public C{public:D(char cd,char ce,char cf, char cg, char ch,char ci):C(cf,cg),B(cd,ce),A(cd),aa(ch){cout<<"D's constructor."<<ci<<endl;}~D() {cout<<"D's destructor."<<endl;}private:A aa;};void main(){D ohj('a','b','c','d','e','f')}

考题 若有以下定义和语句: char*s1="12345",*s2="1234"; printf("%d\n",strlen(strcpy(s1,s2)));则输出结果是______。A.4B.5C.9D.10

考题 阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。[说明]本程序使用类来管理员工的通讯地址信息。已知程序的输出为:输出记录:5姓名:王丽华街道地址:中华路15号市:襄樊市省;湖北省邮政编码:430070[C++程序]include < iostream, h >include < string, h >class employee.{ protected:char name[10];char street[ 20 ];char city[10];char (1) [10];char post[7];int no;(2):(3) (char [] ,char [] ,char [] ,char [] ,char [] ,int);void changename ( char n [] ) { strcpy ( name, n); }void changestreet( char s[] ) { strcpy(street,s) ;}void changecity ( char c [] ) { strcpy ( city, c ); }void changeprov( char p [] ) { strcpy(prov,p); }void changeno(int nnm) { (4);}void display( );};employee:: (3) (char n[] ,char s[] ,char c[] ,char p1[] ,char p2[] ,int nam){ strcpy(name,n);strcpy ( street, s);strcpy ( city, c);strcpy ( prov, p1 );strcpy ( post, p2 );no = nam; }void employee:: display( ) { cont< <"输出记录: "< <no< <endl;cout< < "姓名: "< < name < < endl;coot < < "街道地址: "< < street < < endl;cout < < "市: "< < city < < endl;cout< <"省: "< <prov < <endl;cout < <"邮政编码: "< < post < < endl;}void main( ) { employee cmp("王华" ,"中华路15号" ,"武汉市","湖北省","430070", 1 );emp. changename( "五丽华" );emp. changecity ( "襄樊市" );emp. changeno(5);(5);

考题 已知数组arr的定义如下: intarr[5]={1,2,3,4,5};下列语句中输出结果不是2的是( )。A.cout*arr+1endl;B.COUt*(art+1)endl;C.coutarr[1]endl;D.COUt*arrendl:

考题 请将下面的程序补充完整,使得程序输出“飘是张娜的书”。includeusing namespace stdclass Book{public:Book(char*str)|strcpy(title,str);______void Printlnfo(){cout<<title<<endl;}protected:char title[50];};class MyBook:public Book{public:MyBook(char*s1,char*S2=“张娜”):______strcpy(owner,s2);}virtual void PrintInfo(){cout<<title<<“是”<<owner<<“的书”<<endl;}private:charowner[10];};int main(){Book*ptr=new MyBook(“飘”);ptr-Printlnfo();return 0;}

考题 执行下列语句后,输出结果为cout.put('s');cout<<'c'<<'a';A.caB.seaC.sD.a

考题 下列各个选项中对字符数组赋字符串的语句中,错误的是( )。A.char s[10];s="program";B.char s[]="program";C.char s[10]="program";D.char s[10]; strcpy(s,"program");

考题 若有定义语句:char s[10]="1234567\0\0";,则strlen(s)的值是______。A.7B.8C.9D.10

考题 已知数组arr的定义如下: int arr[5]={1,2,3,4,5}; 下列语句中,输出结果不是2的是A.cout<<*arr+1<<endl;B.tout<<*(arr+1)<<endl;C.cout<<arr[1]<<endl;D.eout<<%arr<<endl;

考题 设有如下函数定义。若在主函数中用语句cout<<f("good")调用上述函数,则输出结果为(48)。 int f(char *s){ char *p=s; while(*p! ='\0')p++; return(p-s); }A.3B.4C.5D.6

考题 以下程序的输出结果是()。includeint fun (char*s){char *p=s;while (*p!='\0,) p++ 以下程序的输出结果是( )。 #include<iostream.h> int fun (char*s) { char *p=s; while (*p!='\0,) p++: return (p-s): } void main() { cout<<fun (" ABCDEF ")<<endl: }A.3B.6C.8D.0

考题 参照函数模板的写法,完成非模板函数的定义,语句为______。 include include 参照函数模板的写法,完成非模板函数的定义,语句为______。include<iostream.h>include<string.h>template<class T>T min(T a,T b){return(a<b? a:b);}char*rain(char*a,char*b){______}void main( ){double a=1.23,b=3.45;char s1[]="abed",s2[]="efg";cout<<min(a,b)<<min(s1,s2)<<endl;}

考题 设有定义:char s[12]={"hello"},则cout<<strlen(s)的输出是 ______。A.5B.6C.11D.12

考题 以下三条输出语句分别输出什么?char str1[] = "abc";char str2[] = "abc";const char str3[] = "abc";const char str4[] = "abc";const char* str5 = "abc";const char* str6 = "abc";cout boolalpha ( str1==str2 ) endl; // 输出什么?cout boolalpha ( str3==str4 ) endl; // 输出什么?cout boolalpha ( str5==str6 ) endl; // 输出什么?

考题 若有定义和语句 ( ) char s[10];s="abcd";printf("%s\n",s); 则结果是(以下μ代表空格)A.输出abcdB.输出aC.abcdμμμμμD.编译不通过

考题 若有以下定义语句: char * sl="12345", * s2="1234"; printf("%d"n",strlen(strcpy(s1,s2))); 则输出结果是 ( )A.4B.5C.9D.10

考题 若有以下定义和语句,则输出结果是(口代表空格)______。char s[10]; s="abcd"; printf("%s\n",s);A.输出abcdB.输出aC.输出abcd口口口口口D.编译不通过

考题 若执行下面的程序时,从键盘上输入3和4,则输出结果是main( ){int a,b,s;cin>>a>>b;s=a;if(a<B)s=b;s=s*s;cout<<s<<endl;}A.14B.16C.18D.20

考题 设char str1[11]="HELLO,",str2[10]=“world”;则执行语句cout 设char str1[11]="HELLO,",str2[10]=“world”;则执行语句 cout<<strlen(strcpy(str1,str2)));后的输出结果是 ______。A.12B.11C.7D.5

考题 当执行cout语句输出endl数据项时,将使C++显示输出屏幕上的光标从当前位置移动到()的开始位置。

考题 设有char *s="ABCDE";cout strlen(s) endl;输出结果是()A、6B、5C、4D、1

考题 设有char *s="ABCDE";cout (s+1) endl;输出结果是()A、AB、BC、ABCDD、BCD

考题 若有定义和语句: char s[10]:s=""abcd"";printf(""%s/n"",s); 则结果是(以下u代表空格)()A、输出abcdB、输出aC、输出abcduuuuuD、编译不通过

考题 单选题设有char *s="ABCDE";cout strlen(s) endl;输出结果是()A 6B 5C 4D 1

考题 单选题若有定义和语句: char s[10]:s=""abcd"";printf(""%s/n"",s); 则结果是(以下u代表空格)()A 输出abcdB 输出aC 输出abcduuuuuD 编译不通过