int count(int goal){ int currentCnt = 1; int currentNum = 1; while(currentNum != goal){ int nextInc = incNum(currentNum); int nextReverse = reverseNum(currentNum); if(nextInc >= nextReverse || nextReverse > goal){ currentNum = nextInc; }else{ currentNum = nextReverse; } currentCnt++; } return currentCnt; }
person::person() { incNum(); }