标签:[] n+1 app .com style raw_input inpu 数列 log
1、数列和
import math m,n = map(int, raw_input().split()) answer = [] for i in range(n): answer.append(m) m = math.sqrt(m) print ‘%.2f‘ % sum(answer)
2、水仙花数
m,n = map(int,raw_input().split()) answer = [] def isFlower(x): return x == sum([int(i)**3 for i in str(x)]) for i in range(m,n+1): if isFlower(i): answer.append(str(i)) if len(answer) != 0: print " ".join(answer) else: print ‘no‘
3、句子反转
import sys print(" ".join(raw_input().strip().split(" ")[::-1]))
标签:[] n+1 app .com style raw_input inpu 数列 log
原文地址:http://www.cnblogs.com/llw1121/p/7613824.html