文章

1

粉丝

43

获赞

0

访问

290

头像
计算Sn 题解:
P1043 北京大学机试题
发布于2024年3月21日 15:40
阅读数 290

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,m;
    cin >> n >> m;
    int tmp = n;
    int ans = 0;
    while(m--)
    {
        ans += n;
        n = n*10 + tmp;
    } 
    cout << ans << endl;
}

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发