H - HN

hhhh

Code
#include<cstdio>
#include<vector>
using namespace std;
vector<int>ans;
int main()
{
    int n;
    scanf("%d",&n);
    while(n) {
        n--;
        if(n%3==0) ans.push_back(2);
        else if(n%3==1) ans.push_back(3);
        else ans.push_back(6);
        n/=3;
        
    }
    for(int i=ans.size()-1;i>=0;i--) printf("%d",ans[i]);
    return 0;
}
posted @ 2021-08-14 13:59  莳曳  阅读(19)  评论(0编辑  收藏  举报