#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#define SIZE 40
char* s_gets(char*, int);
int main(void)
{
char st[SIZE];
int n = 0;
while (n < 5) {
puts(s_gets(st, 10));
// printf("%5d \n", *st);
n++;
}
return 0;
}
char* s_gets(char* st, int n)
{
char c;
int i=0;
for(i=0;i<n;i++)
{
st[i] = getchar();
printf("%d \n", i);
if ((st[i] >= 65 && st[i] <= 90) || (st[i] >= 97 && st[i] <= 122))
;
else if(i>0&&(isblank(st[i])||st[i]=='\n'))
break;
else
{
while (isblank(st[i]=getchar())==0&& st[i]!='\n')
continue;
i = -1;
}
}
if(i>=n)
st[n] = '\0';
if(st[i]!='\n')
while (getchar() != '\n')
continue;
st[i] = '\0';
return st;
}