C/C++の宿題を片づけます 50代目
■ このスレッドは過去ログ倉庫に格納されています
0073名無しさん@そうだ選挙に行こう
2005/09/11(日) 22:01:10#include<string.h>
char*strremove(char*str,char*remove_str){
size_t remove_str_len = strlen(remove_str);
char*i=str,*j=str;
if(remove_str_len)do
while(!strncmp(j,remove_str,remove_str_len))j += remove_str_len;
while(*i++=*j++);
return str;
}
#include<stdio.h>
int main(){
char source[80],remove[80];
printf("文字列:");scanf("%s",source);
printf("削除文字列:");scanf("%s",remove);
printf("結果:%s",strremove(source,remove));
}
■ このスレッドは過去ログ倉庫に格納されています