编写一个程序,判断输入的一行字符是否构成一个合法的C标识符(以下划线_或字母开头,由下划线、字母和数字组成视为合法的C标识符)。(假设输入的字符串非关键字且最大长度为32)
**输入格式要求:getchar()
**输出格式要求:“is\n” “is not\n”
程序运行示例1如下:
$223
is not
程序运行示例2如下:
hello world
is not
代码在此
#include <stdio.h>
int main ( )
{
char c;
int i = 1,flag = 1;
do{
c = getchar();
if (i == 1 &&( c =='_'||('a' <= c && c <= 'z')||('A' <= c &&c <= 'Z'