Example #1
0
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;
}
Example #2
0
person::person()
{
	incNum();
}