卖逼视频免费看片|狼人就干网中文字慕|成人av影院导航|人妻少妇精品无码专区二区妖婧|亚洲丝袜视频玖玖|一区二区免费中文|日本高清无码一区|国产91无码小说|国产黄片子视频91sese日韩|免费高清无码成人网站入口

從字符串s中刪除指定的字符 c語(yǔ)言程序中,從字符串s中刪除指定的字符c?

c語(yǔ)言程序中,從字符串s中刪除指定的字符c?沒(méi)有函數(shù),#include<stdio。H>void main(){TCHAR s[80],CH/tint I,J/tprintf(“input s

c語(yǔ)言程序中,從字符串s中刪除指定的字符c?

沒(méi)有函數(shù),#include<stdio。H>void main(){TCHAR s[80],CH/tint I,J/tprintf(“input string:”)tgets(s)tprintf(“input the specified character to delete CH:”)TCH=getchar()t for(I=J=0s[I]!=“0”I)T/TIF(s[I]!=CH)s[J]=s[i]TS[J]=“”0“t打印(”刪除字符%C后,字符串為%sn”,CH,s) }

用C語(yǔ)言編寫從字符數(shù)組S中刪除存放在數(shù)組C中的字符的程序,急,在線等?

]#<stdio.h>

#include<malloc.h>

#include<string.h>

void deleteChar(char*s,char*c)

{

int slength=strlen(s)

int clength=strlen(c)

int*target=(int*)malloc(slength*sizeof(int))

for(int i=0i<slengthi)

{

target i=0

for(i=0i<slengthi)

for(int j=0j<clengthj)

{

if(s[i]==c[j])

target[i]=1

}

for(i=0i<slengthi)

printf(%d,target[i])

printf(“n”)

for(i=0i<slengthi)

{

if(target[i]==1)

{

for(int j=i 1j<slengthj))

{

if(target[j]==0)

{

s[i]=s[j

]s[j]=“0”

target[j]=1

break

}

}

}

free(target)

}

void main()

{

char a[]=“abcdef”

char b[]=“bd”

deleteChar(a,b)

printf(%sn”,a)

}