#include<stdio.h> #include<string.h> int main() { int i,T,count; char str[1000]; scanf("%d",&T); getchar(); while(T--) { count=0; gets(str); /* int len=strlen(str); printf("%d\n",len); 输入“你大爷”,输出6,所以最后需要除2 */ for(i=0;str[i]!='\0';++i) { if(str[i]<0) ++count; } printf("%d\n",count>>1); } return 0; }