Compare commits
No commits in common. "d2970d183dab8b13e642cb6dbf6ce555b23bcdd5" and "1843d42e7e825deacd49772a204a39bc2f132820" have entirely different histories.
d2970d183d
...
1843d42e7e
@ -75,8 +75,6 @@ int main() {
|
||||
|
||||
最终结果: “12ABC34567890”
|
||||
|
||||
|
||||
|
||||
### 4. 字符串查找
|
||||
|
||||
字符串查找: “123456123abc123hbc”
|
||||
|
@ -1,33 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
<<<<<<< HEAD
|
||||
int main(){
|
||||
char str[100];
|
||||
char subStr[100];
|
||||
int i, j, index;
|
||||
gets(str);
|
||||
gets(subStr);
|
||||
scanf("%d", &index);
|
||||
|
||||
i=strlen(subStr) + strlen(str);//主串+子串=两个合并后的结束符位置
|
||||
str[i] = '\0';
|
||||
i--;//13->i-3 -> i
|
||||
for(j=strlen(str)-1;j>=index;j--){
|
||||
str[i--] = str[j];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// for(i=0;i<strlen(subStr);i++){
|
||||
// str[index+i] =subStr[i];
|
||||
// }
|
||||
puts(str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
=======
|
||||
int main() {
|
||||
char str1[200], str2[100];
|
||||
int i, j, index;
|
||||
@ -66,4 +39,3 @@ int main() {
|
||||
|
||||
return 0;
|
||||
}
|
||||
>>>>>>> 1843d42e7e825deacd49772a204a39bc2f132820
|
||||
|
Loading…
x
Reference in New Issue
Block a user