Back to home page

OSCL-LXR

 
 

    


0001 #
0002 # Licensed to the Apache Software Foundation (ASF) under one
0003 # or more contributor license agreements. See the NOTICE file
0004 # distributed with this work for additional information
0005 # regarding copyright ownership. The ASF licenses this file
0006 # to you under the Apache License, Version 2.0 (the
0007 # "License"); you may not use this file except in compliance
0008 # with the License. You may obtain a copy of the License at
0009 #
0010 #   http://www.apache.org/licenses/LICENSE-2.0
0011 #
0012 # Unless required by applicable law or agreed to in writing,
0013 # software distributed under the License is distributed on an
0014 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
0015 # KIND, either express or implied. See the License for the
0016 # specific language governing permissions and limitations
0017 # under the License.
0018 #
0019 import sys
0020 import re
0021 line = sys.stdin.readline()
0022 x = 1
0023 while line:
0024     tem = sys.stdin.readline()
0025     if line == tem:
0026         x += 1
0027     else:
0028         print(str(x).strip()+'\t'+re.sub('\t', '_', line.strip()))
0029         line = tem
0030         x = 1