将原来的数转变为更小的数,转变方法为9-t(若9-t比t小),需注意的是,转换后的首位数字不可为0.
x = int(raw_input())
line = map(int,str(x))
if line[0] < 9 and (9-line[0] <line[0]):
line[0] = 9-line[0]
for i in range(1,len(line)):
if (9-line[i]) < line[i]:
line[i] = 9-line[i]
print int("".join(map(str,line)))