删除字符串中的数字
来源:互联网 发布:网络管理师考试 编辑:程序博客网 时间:2024/05/17 01:32
#include <iostream>using namespace std;void RemoveNumber(char * str){ char *read = str; char *write = str; while (*read != '\0') { if (*read < '0' || *read > '9') { *write = *read; write++; } read++; } *write = '\0';}int main(){ char str[] = "a88b"; RemoveNumber(str); cout<<str<<endl; return 0;}
a 8 8 b
a b 8 b
a b \0 b
畅游笔试题,复杂度O(n),STL remove算法。
0 0
- 删除字符串中的数字
- 删除字符串中的数字
- 删除字符串中的数字字符
- 删除字符串中的数字并压缩字符串
- 删除字符串中的数字并压缩。
- 删除一个字符串中的数字(C语言)
- 删除字符串中的数字和空格
- c语言删除字符串中的数字字符
- 笔试:删除字符串中的数字并压缩字符串
- 【字符串操作】02.删除字符串中的空格和数字
- 删除输入字符串中的数字,并将大写改小写
- 华为机试——删除字符串中的数字
- 字符串删除数字
- js里判断一个字符串全为数字,js里删除数字中的元素
- 删除字符串中的数字并压缩字符串(神州数码以前笔试题)
- 从字符串中删除数字
- 获取字符串中的数字
- 去除字符串中的数字...
- php中的文件和文件夹操作
- Linux内核中的cdev_alloc和cdev_add
- 倾城之恋
- The selected wizard could not be started. Plug-in org.apache.hadoop.eclipse was unable to load class
- Redmine Agile plugin安装使用方法
- 删除字符串中的数字
- 说一下id3决策树
- 并查集
- 蓝桥有感,
- Android剪切板设置和读取字符串String 关键代码
- delphi窗体之间的相互传值
- 测试HTTP的方便法
- cocos2dx:数据存储-静态数据
- AStyle代码格式工具在source insight中的使用