#include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
cin>>n;
string s="1";
char ch[]={'0','1','2','3','4','5','6','7','8','9'};
for(int i=0;i<n;i++)
{
int flag=0;
for(int j=s.size()-1;j>=0;j--)
{
int temp=s[j]-'0';
temp=temp*2+flag;
flag=0;
if(temp>=10)
{
flag=temp/10;
temp=temp%10;
}
s[j]=temp+'0';
}
if(flag>0)
{
s=ch[flag]+s;
}
}
cout<<s<<endl;
return 0;
}
C++ 实现2的N次方的十进制展示
最新推荐文章于 2024-05-15 13:39:00 发布