#include<stdio.h>
#include<iostream>
#include<string.h>
#include<algorithm>
#include<map>
#include<queue>
#include<math.h>
#include<vector>
using namespace std;
#define ll long long
ll a[1000];
int main()
{
ll n;
cin>>n;
ll k = 0;
if(n == 1)
{
cout<<2;
return 0;
}
while(n > 0)
{
n-=pow(3,k);
k++;
if(n < pow(3,k))break;
}
int num = 0;
while(n > 0)
{
a[num] = (n%3);
n /= 3;
num++;
}
for(int i = k-1;i >= 0 ;i--)
if(a[i] == 0)cout<<2;
else if(a[i] == 1)cout<<3;
else cout<<6;
}
08-15
191
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountBlack.png)
08-14
181
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountBlack.png)
08-15
179
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountBlack.png)
08-20
87
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountBlack.png)
07-18
07-18
07-18
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交