python

 #これで実際かけるのかな?
 ans = []
a = map(str,raw_input().split(","))
b = map(str,raw_input().split(","))
for i in range(len(a)): a[i] = a[i].strip() ; v = a
for i in range(3): b[i] = b[i].strip(); x =0
for i in range(3):
  print v
  for j in range(len(b[i])):
    while len(a) > x:
      if b[i][j] not in a[x]:
        print "nakatta",x
        del a[x]
        continue
      print "atta",x
      x+=1
     if x == len(a)-1:ans.append(a[0])

試し書き。

広告を非表示にする