Not a problem (hey, I made it)
It is very easy to find the corresponding equation solution (a very 2 error was also made in the middle, putting 9 + 10 + 11 +... + 99 is written as (1 + 90) * 90/2. It will be fine after modification)
Not to mention, code is below
#include <iostream>#include <cstdio>#include <cstring>using namespace std;int combi(int a,int b){int sum=1;int j=1;for(int i=a;i>=a-b+1;i--){sum*=i;while(j<=b&&sum%j==0){sum/=j;j++;}}return sum;}int main(){#ifndef ONLINE_JUDGEfreopen("/home/test/samplein","r",stdin);freopen("/home/test/sampleout","w",stdout);#endifchar words[1111];scanf("%s",words);int len=strlen(words);for(int i=0;i<len-1;i++){if(words[i]>=words[i+1]){printf("0\n");return 0;}}int sum=0;for(int i=1;i<len;i++){sum+=combi(26,i);}for(int i=0;i<len;i++){ int j; if(i==0) j='a'; else j=words[i-1]+1;for(;j<words[i];j++){sum+=combi('z'-j,len-i-1);}}printf("%d\n",sum+1);return 0;}