题目描述
Calculate:
Sn=a+aa+aaa+…+aa…aaa, the number a is n, a = 2.
When n = 5, Sn=2+22+222+2222+22222, calculate the sum of Sn.
n is entered by keyboard.
输入
n,less than or equal to 5.
输出
Sn
样例输入 Copy
1
样例输出 Copy
2
a='2'
sum=0
n=int(input())
for i in range(1,n+1):
s=a*i
su=int(s)
sum=sum+su
print(sum)