Advertisement
fooker

ternaryrep (vector output)

Nov 19th, 2022
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. void ternaryrep(ll n){
  2.     vector <ll> v;
  3.     ll x=0;
  4.     while(n>0){
  5.         x=n%3;
  6.         v.push_back(x);
  7.         n=n/3;
  8.     }
  9.     reverse(v.begin(), v.end());
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement