Problem Description
In order to make a new word, we will pick out m letters from all the upper case letters and lower case letters(from a' to
Z'). Therefore, that means you can pick some same letters. But here are two rules:
● as to all the neighbour letters, the absolute value of their ASCII code must be not greater than 32.
● there must be at least one pair of neighbour letters whose absolute value of ASCII code is exactly equal to 32. For example, considering the word in the form like "Xx" or "xX", the neighbour letters have an absolute value of ASCII code exactly equal to 32.
Now how many dierent words can we get?
Input
The first line of input is the number of test case. For each test case, there is only one line contains one integer m(2 ≤ m ≤ 109).
Output
For each test case output one line, just the answer mod 1000000007.
Sample Input
4
2
3
100
7926778
Sample Output
52
4056
533550434
773908369
#include
void main()
{
char s[100];
int num1 = 0; // 统计字母的个数
int num2 = 0; // 统计空格的个数
int num3 = 0; // 统计数字的个数
int num4 = 0; // 统计其他字符的个数
printf("请输入字符串\n");
gets(s);
int i=0;
while (s[i] != '\0')
{
if ((s[i] >= 'a' && s[i] <= 'z') ||
(s[i] >= 'A' && s[i] <= 'Z'))
{
num1 ++;
}
else if (s[i] == ' ')
{
num2 ++;
}
else if (s[i] >= '0' && s[i] <= '9')
{
num3 ++;
}
else
{
num4 ++;
}
i ++; // 移动到下一个字符
}
printf("字母的个数是:%d\n",num1);
printf("空格的个数是:%d\n",num2);
printf("数字的个数是:%d\n",num3);
printf("未知的个数是:%d\n",num4);
printf("%s\n",s);
}