汉字统计
#include <iostream> #include <cstring> using namespace std; int main() { int n, len; char s[1010]; cin >> n; getchar(); while(n --) { gets(s); len = strlen(s); int count = 0; for(int i = 0; i < len; ++ i) { if(s[i] >= 0 && s[i] <= 127) count ++; } cout << (len - count) / 2 << endl; } return 0; }