皮皮学,免费搜题
登录
搜题
【单选题】
下列给定函数fun的功能是:将s所指字符串中出现的与t1所指字符串相同的子串全部替换为t2所指字符串,所形成的新串放在w所指的数组中。要求t1和t2所指字符串的长度相同。 例如,当s所指字符串中的内容为"abcdabfab",t1所指子串中的内容为"ab",t2所指子串中的内容为"99"时,在w所指的数组中的内容"99cd99f99"。 ”/********found*****/”之后所指的语句有错,请选择下列正确的语句替换。 #include #include void fun (char *s, char *t1, char *t2 , char *w) { char *p , *r, *a; strcpy( w, s ); while ( *w ) { p = w; r = t1; while ( *r ) if ( *r == *p ) { r++; p++; } else break; if ( *r == '\0' ) { a = w; r = t2; while ( *r ){ /************found************/ *a = *r; a++; r++ } w += strlen(t2) ; } else w++; } } main() { char s[100], t1[100], t2[100], w[100]; printf("\nPlease enter string S:"); scanf("%s", s); printf("\nPlease enter substring t1:"); scanf("%s", t1); printf("\nPlease enter substring t2:"); scanf("%s", t2); if ( strlen(t1)==strlen(t2) ) { fun( s, t1, t2, w); printf("\nThe result is : %s\n", w); } else printf("Error : strlen(t1) != strlen(t2)\n"); }
A.
*a=*r;
B.
*a=*r;r++;
C.
*a=*r;a++;
D.
*a=*r;a++;r++;
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】在使用Premiere的字幕设计器输入中文时,有时会出现乱码,如图所示,其原因是【图片】
A.
输入了生僻字
B.
没有设置中文字体
C.
没有设置字体大小
D.
软件版本过低
【简答题】岩层的真倾角与视倾角相比,其数值总是 _ _ 视倾角。
【单选题】下列关于经皮吸收制剂特点的叙述,错误的是
A.
主要起局部作用
B.
给药方便
C.
药物利用率低
D.
可减少给药次数
E.
可消除或减弱血浓度的峰谷现象
【单选题】实证主义方法论的代表是()。
A.
韦伯、斯宾塞、齐美尔
B.
孔德、斯宾塞、迪尔凯姆
C.
狄尔泰、韦伯、库利
D.
孔德、斯宾塞、韦伯
【简答题】阅读理解,判断正(T)误(F)。 Jim Green is a student at No. 14 Middle school. He has classes from Monday to Friday. He has many things to do after class. On Monday and Wednesday he helps his friends with their Eng...
【简答题】阅读短文,判断正误,正确的写“T”,错误的写“F”。 Jim Green is a student at No. 14 Middle school. He has classes from Monday to Friday. He has many things to do after class. On Monday and Wednesday he helps his friends with...
【单选题】【图片】在使用Premiere的字幕设计器输入中文时,有时会出现乱码,如图所示,其原因是
A.
输入了生僻字
B.
没有设置中文字体
C.
没有设置字体大小
D.
软件版本过低
【简答题】阅读理解。 Jim Green is a student at No. 14 Middle School. He has classes from Monday to Friday. He has many things to do after class. On Monday and Wednesday he helps his friends with their English. On Tu...
【单选题】关于尿道的描述,错误的是
A.
男性尿道兼有排尿和排精的功能
B.
女性尿道只有排尿的功能
C.
女性尿道开口于阴道前庭
D.
女性尿道特点为宽、短、直
E.
女性尿道不容易被感染
【单选题】实证主义方法论的代表是( )。
A.
韦伯、斯宾塞、齐美尔
B.
孔德、斯宾塞、涂尔干
C.
韦伯、库利
D.
孔德、斯宾塞、韦伯
相关题目: