擅长:python、mysql、java
<p>检查此代码:</p>
<pre><code>#!/usr/bin/env python2
import sys
def myxrange(to):
x = 0
while x < to:
yield x
x += 1
with open(sys.argv[1]) as f:
positions = map(lambda x: long(x) - 1, f.readline().split())
max_pos = max(positions)
for line in f:
new = ''
for i in myxrange(max_pos + 1):
if i in positions and line[positions.index(i)] == '1':
new += 'Y'
else:
new += 'U'
print new.rstrip()
</code></pre>