Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ternaryrep(ll n){
- vector <ll> v;
- ll x=0;
- while(n>0){
- x=n%3;
- v.push_back(x);
- n=n/3;
- }
- reverse(v.begin(), v.end());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement