/*------------------------------------------------------------------------------
将字符串中最前面和最后面的@号去掉,并将字符串中间1个或多个连续的@号替换为1个逗号。
例如:初始字符串为"@@@@@this@is@@@@C@@@pro@@@@",
结果为"this,is,C,pro"
------------------------------------------------------------------------------*/
#include<stdio.h>
#include<string.h>
void rep(char str1[],char str3[])
{
char str2[80];
int front,back,i,j;
/**********Program**********/
/********** End **********/
}
int main()
{
char str1[]="@@@@@this@is@@@@C@@@pro@@@@",str3[80];
rep(str1,str3);
puts(str1);
puts(str3);
return 0;
}
将字符串中最前面和最后面的@号去掉,并将字符串中间1个或多个连续的@号替换为1个逗号。
于 2025-01-28 08:45:20 首次发布