a plus aa plus aaa?
題目說明
輸入兩正整數(a與項次)
求s=a+aa+aaa+aaaa+aa…a的值。假設a=2,項次為3,則輸出結果的形式如:2+22+222=246;
輸入限制: 均>0
輸入
兩正整數
輸出
如上形式所示
sample input1
1 4
sample output1
1234
sample input2
3 2
sample output2
36
輸入兩正整數(a與項次)
求s=a+aa+aaa+aaaa+aa…a的值。假設a=2,項次為3,則輸出結果的形式如:2+22+222=246;
兩正整數
如上形式所示
1 4
1234
3 2
36
Comments