P2084 进制转换:数据有两个不能通过,什么原因?请大佬帮忙看看!感谢!!
查看原帖
P2084 进制转换:数据有两个不能通过,什么原因?请大佬帮忙看看!感谢!!
520425
Pluto_king楼主2021/5/28 23:33
string m, n;
cin >> m >> n;
int len = n.length();
for (int i = 0; i < n.length(); i++)
{
	len = len - 1;
	if (n.substr(i, 1) != "0")
	{
		if (i != n.length() - 1)
		{
			cout << n.substr(i, 1) << "*" << m << "^" << len << "+";
		}
		else
		{
			cout << n.substr(i, 1) << "*" << m << "^" << len;
		}
	}
}
return 0;
2021/5/28 23:33
加载中...