習題8 6 刪除字元 (20 point s

2021-08-29 03:58:51 字數 575 閱讀 9753

本題要求實現乙個刪除字串中的指定字元的簡單函式。

void delchar( char *str, char c );
其中char *str是傳入的字串,c是待刪除的字元。函式delchar的功能是將字串str中出現的所有c字元刪除。

#include #define maxn 20

void delchar( char *str, char c );

void readstring( char s ); /* 由裁判實現,略去不表 */

int main()

/* 你的**將被嵌在這裡 */

a
hppy new yer
void delchar( char *str, char c)

i++;

} str[j]='\0';

}

習題8 6 刪除字元(20 分)

習題8 6 刪除字元 20 分 本題要求實現乙個刪除字串中的指定字元的簡單函式。void delchar char str,char c 其中char str是傳入的字串,c是待刪除的字元。函式delchar的功能是將字串str中出現的所有c字元刪除。include define maxn 20 v...

習題8 6 刪除字元(20 分)

本題要求實現乙個刪除字串中的指定字元的簡單函式。函式介面定義 void delchar char str,char c 其中char str是傳入的字串,c是待刪除的字元。函式delchar的功能是將字串str 現的所有c字元刪除。裁判測試程式樣例 include define maxn 20 vo...

習題8 6 刪除字元(20 分)

本題要求實現乙個刪除字串中的指定字元的簡單函式。void delchar char str,char c 其中char str是傳入的字串,c是待刪除的字元。函式delchar的功能是將字串str 現的所有c字元刪除。include define maxn 20 void delchar char ...