当前位置: 首页> 文旅> 美景 > 广州注册公司费用_双鸭山网络推广_2021时事政治热点50条_可以放友情链接的网站

广州注册公司费用_双鸭山网络推广_2021时事政治热点50条_可以放友情链接的网站

时间:2025/9/10 23:51:20来源:https://blog.csdn.net/YYDS314/article/details/144636138 浏览次数:0次
广州注册公司费用_双鸭山网络推广_2021时事政治热点50条_可以放友情链接的网站

代码

#include <bits/stdc++.h>
using namespace std;
string szp(long long n,int p)
{string s="";while(n){int g=n%p;if(g<10) s=char(g+48)+s;else s=char(g+55)+s;n=n/p;}return s;
}
long long pzs(string s,int p)
{long long h=0,w=1;for(int i=s.size()-1; i>=0; i--){if(isdigit(s[i])) h+=(s[i]-48)*w;else h+=(s[i]-55)*w;w*=p;}return h;
}
long long dxs(int n)
{int s=0;while(n!=0){int g=n%10;n=n/10;s=s*10+g;}return s;
}
int main()
{ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);int n,s=0;string m;cin>>n>>m;while(1){s++;long long tno=pzs(m,n)+dxs(pzs(m,n));
//		cout<<tno<<" ";if(tno==dxs(tno)){cout<<s;return 0;}else m=szp(tno,n);
//		cout<<'\n';if(s>30){cout<<"Impossible!";return 0;}}return 0;
}

#include <bits/stdc++.h>
using namespace std;
string szp(long long n,int p)
{
    string s="";
    while(n)
    {
        int g=n%p;
        if(g<10) s=char(g+48)+s;
        else s=char(g+55)+s;
        n=n/p;
    }
    return s;
}
long long pzs(string s,int p)
{
    long long h=0,w=1;
    for(int i=s.size()-1; i>=0; i--)
    {
        if(isdigit(s[i])) h+=(s[i]-48)*w;
        else h+=(s[i]-55)*w;
        w*=p;
    }
    return h;
}
long long dxs(int n)
{
    int s=0;
    while(n!=0)
    {
        int g=n%10;
        n=n/10;
        s=s*10+g;
    }
    return s;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int n,s=0;
    string m;
    cin>>n>>m;
    while(1)
    {
        s++;
        long long tno=pzs(m,n)+dxs(pzs(m,n));
//        cout<<tno<<" ";
        if(tno==dxs(tno))
        {
            cout<<s;
            return 0;
        }
        else m=szp(tno,n);
//        cout<<'\n';
        if(s>30)
        {
            cout<<"Impossible!";
            return 0;
        }
    }
    return 0;
}
 

关键字:广州注册公司费用_双鸭山网络推广_2021时事政治热点50条_可以放友情链接的网站

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: