[单选题]

有以下程序

#include <string.h>

main( )

{ char p[20]={ 'a', 'b', 'c', 'd'},q[]="abc", r[]="abcde"

strcat(p,r); s trcpy(p+strlen(q),q);

p rintf("%d/n", strlen (p));

}

程序运行后的输出结果是

A.)9

B.)6

C.)11

D.)7

参考答案与解析:

相关试题

有以下程序#include <string.h>main( ){ char p[

[单选题]有以下程序#include <string.h>main( ){ char p[20]={'a','b','c','d'},q[]="abc", r[]="abcde";strcpy(p+strlen(q),r); strcat(p,q);printf("%d%d/n",sizeof(p),strlen(p));}程序运行后的输出结果是A.)20 9B.)9 9C.)20 11D.)11 11

  • 查看答案
  • 有以下程序 #include<string.h> main() {char p[

    [单选题]有以下程序#include<string.h>main(){ char p[]={′a′, ′b′, ′c′},q[10]={ ′a′, ′b′, ′c′};printf("%d%d/n",strlen(p),strlen(q));}以下叙述中正确的是A.在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3B.由于p数组中没有字符串结束符,长度不能确定,但q数组中字符串长度为3C.由于q数组中没有字符串结束符,长度不能确定,但p数组中字符串长度为3D.由于p和q

  • 查看答案
  • 有以下程序 #include<string.h> main() {char p[

    [单选题]有以下程序#include<string.h>main(){ char p[]={′a′, ′b′, ′c′},q[10]={ ′a′, ′b′, ′c′};printf("%d%d/n",strlen(p),strlen(q));}以下叙述中正确的是A.在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3B.由于p数组中没有字符串结束符,长度不能确定,但q数组中字符串长度为3C.由于q数组中没有字符串结束符,长度不能确定,但p数组中字符串长度为3D.由于p和q

  • 查看答案
  • 有以下程序 # include <string.h> main() {char

    [单选题]有以下程序# include <string.h>main(){char p[20]={′a′, ′b′, ′c′, ′d′}, q[]="abc", r[]="abcde";strcat(p, r); strcpy(p+strlen(q), q);printf("%d/n",strlen(p));}程序运行后的输出结果是A.9B.6C.11D.7

  • 查看答案
  • 有以下程序 # include <string.h> main() {char

    [单选题]有以下程序# include <string.h>main(){char p[20]={′a′, ′b′, ′c′, ′d′}, q[]="abc", r[]="abcde";strcat(p, r); strcpy(p+strlen(q), q);printf("%d/n",strlen(p));}程序运行后的输出结果是A.9B.6C.11D.7

  • 查看答案
  • 有以下程序#include <string.h>void f(char p[][

    [单选题]有以下程序#include <string.h>void f(char p[][10], int n ) /* 字符串从小到大排序 */{ char t[10]; int i,j;for(i=0;i<n-1;i++)for(j=i+1;j<n;j++)if(strcmp(p[i],p[j])>0) {strcpy(t,p[i]); strcpy(p[i],p[j]); strcpy(p[i],t); }}main( ){ char p[5][10]={"abc"

  • 查看答案
  • 有以下程序#include <string.h>main( int argc,

    [单选题]有以下程序#include <string.h>main( int argc, char *argv[ ]){ int i=1,n=0;while (i< argc) {n=n+strIen ( angv[i ] ) ;i++; }printf("%d/n",n);}该程序生成的可执行文件名为: proc.exe 。若运行时输入命令行:proc 123 45 67则程序的输出结果是A.)3B.)5C.)7D.)11

  • 查看答案
  • 有以下程序 #include <string.h>main(){ FILE *f

    [单选题]有以下程序 #include <string.h>main(){ FILE *fp; int i,k,n; fp=fopen("data.dat", "w+"); for(i=4; i<9; i++) { fprintf(fp,"%d",i); if(i%3==0) fprintf(fp,"/n"); } rewind(fp); fscanf(fp,"%d%d",&k,&n); printf("%d %d/n",k,n); fclose(

  • 查看答案
  • 有以下程序:<br />#include <stdio.h><br />#include <string.h><br />main()<

    [单选题]有以下程序:#include #include main(){ char str[]={"Hello,Beiji

  • 查看答案
  • 有以下程序:include<stdio.h> include<string.h>

    [单选题]有以下程序:include<stdio.h> include<string.h>main{ char x[]="STRING"有以下程序:include<stdio.h>include<string.h>main{ char x[]="STRING";x[0]=0;x[1]=/0;x[2]=0;printf("%d %d/n",sizeof(x),strlen(x));}程序运行后的输出结果

  • 查看答案
  • 有以下程序#include <string.h>main( ){ char p[