/**/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <queue>
typedef long long LL;
typedef unsigned long long ULL;
using namespace std;
const int maxn = 100005;
char str[maxn];
int main()
{
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
int n;
cin >> n;
while(n--) {
getchar();
cin.get(str,maxn);
int i, cnt = 0, len = strlen(str);
for(i = 0; i < len; i++)
if(str[i] & 0x80)
cnt++;
cout << cnt / 2 << endl;
}
return 0;
}
/**/
HDOJ 2030 统计汉字个数
最新推荐文章于 2021-07-18 18:25:14 发布
博客介绍了汉字在计算机中的存储情况,汉字占两个字节,其机内码为与国际码区分,在字符高位和下一位用1标识。还提到串中字符、数字和汉字里,只有汉字高位为1。
6212

被折叠的 条评论
为什么被折叠?



