#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.)3
B.)5
C.)7
D.)11
[单选题]有以下程序# 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 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 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.)9B.)6C.)11D.)7
[单选题]有以下程序#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(){ 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(
[单选题]有以下程序#include <string.h>struct STU{ int num; float TotalScore; };void f(struct STU p){ struct STU s[2]={{1047,530},{1048,531}}; p.num = s[1].num; p.TotalScore = s[1].TotalScore;}main(){ struct STU s[2]={{2041,730},{2042,731}}; f(s[0]); printf(
[单选题]有以下程序#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[]={′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
[单选题]有以下程序: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));}程序运行后的输出结果