[C++] 纯文本查看 复制代码 #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,maxs,max1,m,t=0,i=0;
cin>>n;
int s=n;
while(1)
{
max1=max(max1,s%10);
if(s==0)
{
break;
}
s=s/10;
}
m++;
s=n;
while(1)
{
t+=(s%10)*pow(m,i);
if(s==0)
{
break;
}
s=s/10;
i++;
}
cout<<t;
} |