#include "stdafx.h"
char word[100] = { "hello hellll heeeek heehehk kkkkkk" };
bool Is_char(char m)
{
if ((m > 'a' && m < 'z') || (m > 'A' && m < 'Z'))
{
return 1;
}
else
{
return 0;
}
}
int main()
{
int num = sizeof(word) / sizeof(char);
int length = 0;
int len = 0;
int i = 0;
int start_pos = 0;
int start_flag = -1;
int rtn_pos = -1;
for (i = 0; i < num; i++)
{
if (Is_char(word[i]))
{
if (start_flag == 0)
{
start_pos = i;
start_flag = 1;
//len = 1;
}
len++;
}
else
{
if (len > length)
{
length = len;
rtn_pos = start_pos;
}
start_flag = 0;
len = 0;
}
}
printf("len:%d",length);
printf("pos:%d", rtn_pos);
return 0;
}