#include
#include
int main()
{
int strSize = 100;
char *str = (char *)malloc(sizeof(char) * strSize);
int charNum = 0;
char input;
//逐个字符输入字符串,可以输入int可以表示的最大值个字符
printf("请输入任意个字符:\n");
while(true)
{
scanf("%c",&input);
if(input != '#')
{
if((input >= 'A' && input <= 'Z') || (input >= 'a' && input <= 'z'))
{
if(charNum > strSize)
{
strSize += 100;
str = (char *)realloc(str,strSize);
}
str[charNum] = input;
charNum++;
}
}
else
{
break;
}
}
//输入结果分析
int i = 0,j = 0;