$1 x 3^2 + 2 x 3^1 + 0 x 3^0 = 1x9 + 2x3 + 0x0 = 9+6+0 = 15$
3|462 +--- 3|154 R 0 +--- 3|51 R 1 +-- 3|17 R 0 +-- 3|5 R 2 +- 1 R 2
#include <iostream> #include < string> using namespace std; string IntToTrinary(int number); int TrinaryToInt(string number); ... int main() { } string IntToTrinary(int number){ } int TrinaryToInt(string number){ }