class Solution {
public:
bool check(char a,char b)
{
int num=(a-'0')*10+(b-'0');
if(num>=10&&num<=25) return true;
return false;
}
int getTranslationCount(string s) {
int f[110],n=s.size();
s=' '+s;
memset(f,0,sizeof f);
f[0]=1;
for (int i = 1; i <= n; i ++ )
{
f[i]+=f[i-1];
if(i>=2&&check(s[i-1],s[i]))
f[i]+=f[i-2];
}
return f[n];
}
};
标签:10,num,数字,char,翻译成,&&,字符串,check
From: https://www.cnblogs.com/tangxibomb/p/17356546.html