标签:printf for return puts ++ signed char s 不能 amp
下面是用C写的一个判断汉字的程序:
#include<stdio.h>
int main(void)
{
int i;
//mr:: str[80]的类型不能写成 char,必须加上 unsigned
unsigned char str[80];
puts("input string:");
scanf("%s",str);
for(i=0;i<80&&str[i]!=‘\0‘;)
{
if(str[i]>=0xb0&&str[i]<=0xf7&&str[i+1]>=0xa1&&str[i+1]<=0xfe)
{
printf("chinese character\n");
i+=2;
}
else
{
printf("other character\n");
i++;
}
}
return 0;
}
标签:printf for return puts ++ signed char s 不能 amp
原文地址:https://www.cnblogs.com/onecrazystone/p/12852860.html