首页/ 题库 / [单选题]以下程序 #include<string的答案

以下程序 #include<string.h> main() { char a1[80],a2[80],*s1=a1,*s2=a2; gets(s1);gets(s2) if(!strcmp(s1,s2))printf("*"); else printf("#"); printf("%d ",strlen(strcat(s1,s2))); } 如果从键盘上输入: book<回车> book<空格><回车> 则输出结果是( )

单选题
2022-03-12 01:33
A、*8
B、#9
C、#6
D、*9
查看答案

正确答案
B

试题解析

标签:
感兴趣题目
有以下程序:#include #include #include main(){ char*p1,*p2; p1=p2=(char*)malloc(sizeof(char)*10); strcpy(p1,malloc); strcpy(p2,p1+1); printf(%c%c, p1[0], p2[0]);}程序的运行结果是(  )。
设已执行预编译命令#include<string.h>,以下程序段的输出结果是 char s[]=" an apple" ; printf("%d ",strlen(s));
设已执行预编译命令#include<string.h>,以下程序段的输出结果是( )。 char s[]=" an apple" ; printf(" %d " ,strlen(s));
下列程序的输出结果是( )。 #include<stdio.h> #include<string.h> main() { char a[]=" 123\"; printf("%d,%d ",strlen(a),sizeof(a)); }
有以下程序: #include <iostream> #include <string> using namespace std; int main () { char s[]=" 123\"; cout<<strlen (s) <<", "<<sizeof (s) <<end1; return 0; }
有以下程序: #include <stdio.h> main( ) { char s[ ] ="159" , * p; p=s; printf( "% c", * p + + ); printf("%~", * p++);}程序运行后的输出结果是( )。
有以下程序:
#include<stdio.h>
#include<string.h>
main(  )
{printf{"%d",strlen("%d",strlen("ATS0121"));}   
程序运行后的输出结果是(  )。
有以下程序: #include <stdio.h> #include <string.h> main() { char str[][20]={"Hello","Beijing"},*P=str[0]; printf("%d ",strlen(p+20)); } 程序运行后的输出结果是( )。
以下程序: #include<stdio.h> #include<string.h> main() {char str[]="abcd 123xab"; printf("%d",(str)); } 运行后的输出结果是( )。
以下程序的输出结果是 #include<iostream.h> void main( ) { char x=040; cout < < (X < < 1) ;}
以下程序的输出结果是 #include<iostream.h> void main() { char x=040; cout<<(x<<1);}
有以下程序 #include <stdio.h> #include <string.h> void fun(char *s[],int n) { char *t; int i,j; for(i=0;i<n-1;++) for(j=i+1;j<n;j++) if(strlen(s[i])>strlen(s[j])) {t=s[i];s[i];s[j];s[j]=t;} } main() { char *ss[]={"bcc
相关题目
设有以下定义和程序: #include<iostream.h> class A1 { public: void show1() { cout<<"class A1"<<endl; } }; class A2:public A1 { public: void show2() { cout<<"class A2"<<endl; } }; class A3:protected A2 { public: void show3() { cout<<"class A1"<<endl; } }; void main() { A1 obj1; A2 obj2; A3 obi3; } 则以下不合语法的调用语句是( )。
有以下程序: #include<string.h> main() { char str[][20]={"Hello","Beijing"),*p=str[0]; printf("%d ",strlen(p+20)); } 程序运行后的输出结果是( )。
有以下程序: # include<string.h> main() { char str[][20]={"Hello","Beijing"},*p=str; printf("%d ",strlen(p+20)); } 程序运行后的输出结果是 ______。
有以下程序: #include<stdio.h> void fun(char**p) { ++P;printf("%s ",*p);} main() char*a[]={"Morning","Afternoon","Evening","Night"}; fun(A); } 程序的运行结果是( )。
有以下程序 #include<stdio.h> void fun(char**p) {++p;printf("%s",*p);} main {char*a[]={"Morning","Afternoon","Evening"," Night"); fun(a); } 程序的运行结果是( )。
下面程序的输出结果是( )。 #include<iostream.h> #include"string.h" void main() {char a[]="Hello Test",b[]="Test"; strcpy(a,b); cout<<a<<end1; } A) B)C) D)
下列程序的输出结果是( )。 #include<iostream.h> #include"string.h" void main() {char a[]="Hello Test",b[]="Test"; strcpy(a,b); cout<<a<<end1; }
有以下程序,程序运行的结果是 ______。 #include<iostream.h> #include<string.h> void main(){ char x[]= "C++" ,y[10]= "C++" ; cout<<sizeof(x)/sizeof(char)<<“,”<<sizeof(y)/sizeof(char); }
请读程序: # includde<stdio.h> # include<string.> void fun(char * s) {char a[10]; strcpy(a,"STRING"); s=a; } main() { char*p; fun(p); print{("%s ",p); } 上面程序的输出结果(表示空格) ( )
当执行下面的程序时,如果输入ABC,输出结果是 ______。 #include<iostream.h> #include<string.h> void main(){ char ss[10]=“XYZWV”; cin>>ss; strcat(ss,”DEFG”); cout<<ss; }
当执行下面的程序时,如果输入ABC,则输出结果是______。 #include "stdio.h" #include "string.h" main() { char ss[10]="12345"; gets(ss);strcat(ss,"6789"); printf("%s ",ss); }
当执行下面的程序时,如果输入ABC,则输出结果是 ( ) # include<stdio.h> # include<string.h> main( ) { char ss [10] ="12345"; gets(ss);strcat(ss"6789");printf("%s ",ss); }
有以下程序:#include main(){ char s[10] = verygood, *ps = s; ps += 4; ps = nice; puts(s);}程序的运行结果是(  )。
有以下程序:#include #include main(){ char a[20]=ab,b[20]=cdef; int k=0; strcat(a,b); while(a[k]!='\0') {  b[k]=a[k];  k++; } puts(b);}程序的运行结果是(  )。
有以下程序#include void  fun(char *a, char *b){ while(*a=='*') a++; while(*b=*a) {  b++;  a++; }}main(){ char *s=*****a*b**** , t[80]; fun(s,t); puts(t);}程序的运行结果是(  )。
有以下程序:#include#includemain(){ char w[20],a[5][10]={abcdef,ghijkl,mnopq,rstuv,wxyz.}; int i; for(i=0;i<5;i++)w[i]=a[i][strlen(a[i])-1]; w[5]='\0'; puts(w);}程序的运行结果是(  )。
有以下程序: #include <stdio.h> main( ) { chars[] ="Yes /No",*ps=s; puts(ps +4); * (pa +4) =0; puts(s); }程序运行后的输出结果是( )。
阅读下列程序,则在执行后,程序的运行结果为 #include"stdio.h" #include"string.h" main() { char a[30]="nice to meet you!"; strcpy(a+strlen(a)/2,"you"); printf("%s ",a);}
设有以下定义和程序: #include<iostream.h> class A1 { public: void show1() { cout<<"class A1"<<endl; } }; class A2:public A1 { public: void show2() { cout<<"class A2"<<endl; } }; class A3:protected A2 { public: void show3() { cout<<"class A1"<<endl; } }; void main() { A1 obj1; A2 obj2; A3 obi3; } 则以下不合语法的调用语句是( )。
以下程序 #include<string.h> main() { char a1[80],a2[80],*s1=a1,*s2=a2; gets(s1);gets(s2) if(!strcmp(s1,s2))printf("*"); else printf("#"); printf("%d ",strlen(strcat(s1,s2))); } 如果从键盘上输入: book<回车> book<空格><回车> 则输出结果是( )
广告位招租WX:84302438

免费的网站请分享给朋友吧