{ char a[30]="nice to meet you!"; strcpy(a+strlen(a)/2,"you"

joefeng902022-10-04 11:39:541条回答

{ char a[30]="nice to meet you!"; strcpy(a+strlen(a)/2,"you"); printf("%s\n",a);

已提交,审核后显示!提交回复

共1条回复
太医不幸流产 共回答了12个问题 | 采纳率100%
#include
#include
void main()
{ char a[30]="nice to meet you!";
strcpy(a+strlen(a)/2,"you");
printf("%sn",a);
}
输入出为:nice to you
strlen(a)/2=17/2=8 ,a+strlen(a)/2表示从a+8处【a代表数组首地址】开始复制,"nice to ”刚好6个字母和2个空格,然后复制you,输出nice to you
1年前

相关推荐