Description
计算Sn:Sn=a+aa+aaa+……aaaa(n个a)。a是1~9的数字;n是指定的项数。
Input
输入a(1≤a≤9)和n(n≥1),用逗号分隔。
Output
输出Sn。
Sample Input
2,4
Sample Output
2468
HINT
#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn=1e5;
typedef long long LL;
int main(void)
{
LL n,k;char str;
while(cin>>n>>str>>k)
{
LL sum1=0;LL sum2=0;
for(LL i=1;i<=k;i++)
{
sum2=sum2*10+n;
sum1+=sum2;
}
cout<<sum1<<endl;
}
return 0;
}