判断字符是中文还是英文
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
unsigned char input[50];
cin >> input;
int flag = 0;
for (int i = 0; i < 50; i++)
{
if (input[i] > 0xa0 && input[i] != 0)
{
if (flag == 1)
{
cout << "chinese character" << endl;
flag = 0;
}
else
{
flag++;
}
}
else if (input[i] == 0)
{
break;
}
else
{
cout << "english character" << endl;
}
}
return 0;
}