首页 > 其他 > 详细

HackerRank - "Building a Smart IDE: Identifying comments"

时间:2015-06-03 08:23:37      阅读:251      评论:0      收藏:0      [点我收藏+]
import re

import io
import sys
input_stream = io.TextIOWrapper(sys.stdin.buffer, encoding=utf-8)

s = input_stream.readlines()
s = "\n".join(s)

pc = (//.*|/\*[\d\D]*?\*/)
mc = re.findall(pc, s)
for v in mc:
    vs = v.split("\n\n")
    for l in vs:
        print (l.lstrip())

HackerRank - "Building a Smart IDE: Identifying comments"

原文:http://www.cnblogs.com/tonix/p/4548203.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!