# include <stdio.h>
void delnum(char s[])
{
int i = 0;
int j;
while (s[i]) {
while ('0' <= s[i] && s[i] <= '9') {
j=i;
while(s[j]!='\0'){
s[j]=s[j+1];
j++;
}
}
i++;
}
/* いい線いってると思うけど・・・ */
}
int main(void)
{
char str[] = "3Hello2Wo1ld9!";
printf("%s\n", str);
delnum(str);
puts("チェーーーンジ!!!");
printf("%s\n", str);
return 0;
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme