> 其他 >
{ char a[30]="nice to meet you!"; strcpy(a+strlen(a)/2,"you"); printf("%s\n",a);
人气:148 ℃ 时间:2020-06-05 18:03:11
解答
#include #include void main() {char a[30]="nice to meet you!";strcpy(a+strlen(a)/2,"you"); printf("%s\n",a); }输入出为:nice to youstrlen(a)/2=17/2=8 ,a+strlen(a)/2表示从a+8处【a代表数组...strlen(a)/2=17/2=8 当中的17是怎么得来的???应该是14吧。"nice to meet you!"这个字符串有14个字母和3个空格组成,长度为17,空格也计算在内的
推荐
猜你喜欢
© 2025 79432.Com All Rights Reserved.
电脑版|手机版