国产成人毛片视频|星空传媒久草视频|欧美激情草久视频|久久久久女女|久操超碰在线播放|亚洲强奸一区二区|五月天丁香社区在线|色婷婷成人丁香网|午夜欧美6666|纯肉无码91视频

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

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

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

沒有函數(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語言編寫從字符數(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)

}