1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课外】13.指针1/6-1 删除字符串中数字字符.c

14 lines
280 B
C
Raw Permalink Normal View History

2024-11-29 08:43:30 +00:00
void delnum(char *s) {
int s_len = strlen(s);
for (int i = 0; i < s_len; i++) {
if (s[i] >= '0' && s[i] <= '9') {
for (int j = i; j < s_len; j++) {
s[j] = s[j + 1];
}
s_len--;
i--;
}
}
}