//第二题测试用例过,提交通过 0%。有没有大佬帮看一下问题在哪里?谢过! #include <iostream> #include <cstdio> #include<string> using namespace std; int process(string s) {     int count = 0;     bool flag = false;     for (int i = 0; i < s.size(); i++) {         if (s[i] == ')')             flag = false;         if (s[i] == '(')             flag = true;         if (flag==false&&(s[i] >= 'a'&&s[i] <= 'z') || (s[i] >= 'A'&&s[i] <= 'Z')) {             count++;         }     }     return count; } int main() {     int T;     cin >> T;     for (int i = 0; i < T; i++) {         int N;         cin >> N;         int count = 0;         string s;         char c = getchar();         for (int j = 0; j < N; j++) {             getline(cin, s);             count+=process(s);             if (s[0] == '+')                 count++;         }         cout << count<<endl;     }     return 0; }
点赞 7

相关推荐

10-22 19:18
上海大学 后端
jopajhhdjwnqk:水印都叠杀人书了
点赞 评论 收藏
分享
牛客网
牛客企业服务