string cheng(string a, int b)
{
	string c;
	
	long long la = a.size();
	long long t = 0;
	for(long long i = 0; i < la; i++)
	{
		t += (a[la-1-i] - '0') * b;
		c += t % 10 + '0';
		t /= 10;
	}
	while(t)
	{
		c += t % 10 + '0';
		t /= 10;
	} 
	while (c.size() > 1 && c.back() == '0') 
		c.pop_back();
	reverse(c.begin(), c.end());
	return c;
}

0 comments

No comments so far...