#include #include #include using namespace std; int table[10][10] = { {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, {1, 2, 3, 4, 5, 6, 7, 8, 9, 1}, {2, 3, 4, 5, 6, 7, 8, 9, 1, 2}, {3, 4, 5, 6, 7, 8, 9, 1, 2, 3}, {4, 5, 6, 7, 8, 9, 1, 2, 3, 4}, {5, 6, 7, 8, 9, 1, 2, 3, 4, 5}, {6, 7, 8, 9, 1, 2, 3, 4, 5, 6}, {7, 8, 9, 1, 2, 3, 4, 5, 6, 7}, {8, 9, 1, 2, 3, 4, 5, 6, 7, 8}, {9, 1, 2, 3, 4, 5, 6, 7, 8, 9} }; static vector digitize(string s) { int size = s.length(); vector digits; for (int i=0; i add(vector ss) { int size = ss.size(); vector added; for (int i=0; i ss) { int size = ss.size(); vector reduced = ss; for (int i=0; i> T; for (int i=0; i> s; vector ss = digitize(s); int r = reduce(ss); cout << r << endl; } }