如何返回第一个非空白字符
我用get_first来返回输入的第一个空白字符,感觉太长了,谁来简化看看,能不能把条件放到while里面
程序代码:#include<stdio.h>
#include<ctype.h>
char get_first(void);
int main(void)
{
char ch;
ch=get_first();
putchar(ch);
}
char get_first(void)
{
int ch;
ch=getchar();
while(1)
{
if(!isspace(ch))
break;
else
ch=getchar();
}
while(getchar()!='\n')
continue;
return ch;
}









