1 #include<iostream> 2 #include<iomanip> 3 //#include<bits/stdc++.h> 4 #include<cstdio> 5 #include<cmath> 6 #include<cstring> 7 #include<sstream> 8 #include<algorithm> 9 #define PI 3.14159265358979 10 #define LL long long 11 #define eps 0.00000001 12 #define LL long long 13 using namespace std; 14 int main() 15 { 16 char c[1000]; 17 int T; 18 cin>>T; 19 getchar(); 20 while(T--) 21 { 22 gets(c); 23 int sum=0; 24 int L=strlen(c); 25 for(int i=0;i<L;++i) 26 { 27 if(int(c[i])<0) ++sum; 28 29 } 30 cout<<sum/2<<endl; 31 } 32 }
原文:https://www.cnblogs.com/Auroras/p/10800798.html