遍历遍历!!! # 输入两个数n,a, 输出对应的结果 # 如: n=3,a=2; 输出 2 + 22 + 222 的值。(****) # 如: n=4,a=3; 输出 3 + 33 + 333 + 3333的值。 # 提示: 1、n = 3,相加三次,每次相加比前一次相加的数,多一位 # 2、每次多的这个位数的值为a, 3, 3*10+3(33), 33*10+3(333),... # num1 = int(input("请输入要加几次数:")) # num2 = int(input("请输入要相加的数:")) # b = num2 # sum = 0 # for i in range(num1): # sum += num2 # num2 = num2 * 10 + b # print(sum)