Given no more than two positive integers a and n 9, requiring programming find a + aa + aaa ++ ⋯ + aa ⋯ a (n th a) the sum.
Input format:
input gives no more than 9, and n is a positive integer in a row.
Output format:
in accordance with "s = and corresponding to" format in the output line.
Sample input:
23
Sample Output:
S = 246
a,n=input().split()
n=int(n)
s=sum(int(a*i) for i in range(1,n+1))
print("s = %d"%s) #运用字符串的*性质