杭电OJ2030
汉字机内码为负数且占两个字节,而其他文字不是负数。即转换为求负数的个数并除以二
#include<stdio.h>
#include<string.h>
int main(){
char str[1000];
int n = 0,count=0;
while(scanf("%d",&n)!=EOF){
getchar();
for(int i =0;i<n;i++){
count=0;
gets(str);
for(int j = 0;j<strlen(str);j++){
if(str[j]<0){
count++;
}
}
printf("%d\n",count/2);
}
}
return 0;
}