标签:
#include<iostream>
#include<math.h>
using namespace std;
int main(){
int n;
cin>>n;
int m;//进制数
cin>>m;
double sum=0.0;
int k=0;
while (n!=0)
{
int a=n%10;
sum=a*pow(m,k++)+sum;
n/=10;
}
cout<<sum;
}
标签:
原文地址:http://blog.csdn.net/a819721810/article/details/46391363