解题思路:
找出An规律发现,An=An-1+第n个字母+An-1
看明白这个就简单了!!!
参考代码:
s=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
n=int(input())
res=""
for i in range(1,n+1):
res=res+s[i-1]+res
print(res)
0.0分
3 人评分