#include using namespace std; long convert(long val, long base) // // return base 10 equivalent of , assuming it's in base // . If unable to do so, return 0. // { long r = 1; long ret = 0; while (val > 0) { long d = val%10; if (d >= base) return 0; ret += r*d; r *= base; val /= 10; } return ret; } bool good(long vals[], long n, long base) // // return true if values in is an arithmetic sequence in // base // { long a[5]; for(long i=0; i> n; while (n != 0) { for(long i=0; i> vals[i]; long base = 2; while (base <= 10 && !good(vals, n, base)) base++; if (base > 10) cout << "No base <= 10 can be found." << endl; else cout << "Minimum base = " << base << "." << endl; cin >> n; } }