文章

54

粉丝

66

获赞

54

访问

3.5k

头像
计算Sn (模拟,注意数据范围)题解:
P1043 北京大学机试题
发布于2024年4月20日 23:58
阅读数 84

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

int x, n;
LL ans;

int main()
{
	cin >> x >> n;
	
	LL t = 0;
	for(int i = 1; i <= n; i ++)
	{
		t = (t * 10 + x);
		ans += t;
	}
	
	cout << ans;
	
	return 0;	
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发