起点客户端上允许用户对作品进行评论,为了防止用户恶意评论,发表不当内容,需要对用户发布的内容进行过滤,请写程序过滤用户发布内容中带有的QQ号(6~10位数字组成) 允许对内容严格操作,如用户发表了 作者大大666666,为你点赞 ,经过过滤后也可以为作者大大,为你点赞 ,将666666过滤掉了。
示例1
输入
"作者大大666666666,为你点赞"
输出
"作者大大,为你点赞"
说明
备注:
QQ号显然是不能以0开头的,请注意
加载中...
import java.util.*; public class Solution { /** * 过滤内容中出现的QQ号 * @param content string字符串 待过滤内容 * @return string字符串 */ public String filterContent (String content) { // write code here } }
class Solution { public: /** * 过滤内容中出现的QQ号 * @param content string字符串 待过滤内容 * @return string字符串 */ string filterContent(string content) { // write code here } };
# # 过滤内容中出现的QQ号 # @param content string字符串 待过滤内容 # @return string字符串 # class Solution: def filterContent(self , content ): # write code here
/** * 过滤内容中出现的QQ号 * @param content string字符串 待过滤内容 * @return string字符串 */ function filterContent( content ) { // write code here } module.exports = { filterContent : filterContent };
# # 过滤内容中出现的QQ号 # @param content string字符串 待过滤内容 # @return string字符串 # class Solution: def filterContent(self , content ): # write code here
package main /** * 过滤内容中出现的QQ号 * @param content string字符串 待过滤内容 * @return string字符串 */ func filterContent( content string ) string { // write code here }
/** * 过滤内容中出现的QQ号 * @param content string字符串 待过滤内容 * @return string字符串 */ char* filterContent(char* content ) { // write code here }
"作者大大666666666,为你点赞"
"作者大大,为你点赞"