leetcode-剑指46-OK

// language c
// 剑指46
// https://leetcode-cn.com/problems/ba-shu-zi-fan-yi-cheng-zi-fu-chuan-lcof/

int translateNum(int num){	// 递归
	if(num<10)
		return 1;
	if(num<26)
		return 2;
	if(num<100)
		return 1;
	return translateNum(num/10)+translateNum(num/100)*(translateNum(num%100)-1);
}
posted @ 2021-01-28 10:38  RougeBW  阅读(26)  评论(0编辑  收藏  举报