//Problem Practice C - Sequence #include \\convert int A to base bb int convert(int A, int bb) { int n,b; b=bb; n = A%10; A = A/10; while(A>0) { n += (A%10)*b; b *= bb; A = A/10; } return n; } //find the starting base (find largest digit present, // the startubg base is largest digit + 1) int firstbase(int * nums, int n) { //find largest digit int big=1,A,i; for(i=0;i0){ if(A%10 > big) big = A%10; A=A/10; } } return big+1; } void main() { int nums[5], diff, base, i,n,OK,start; cin>>n; while(n>0) { for(i=0;i>nums[i]; start=firstbase(nums,n); //find starting base for(base=start;base<11;base++) { OK=1; //OK =1 until we find it's not arithmetic //get 1st difference diff = convert(nums[1],base)-convert(nums[0],base); //now check the other differences for(i=2;i>n; } }