1 条题解
-
-1njnu19180226 LV 8 @ 2019-04-16 16:20:04
#include<stdio.h> #include<iostream> #include<vector> #include<string> using namespace std; vector<string> qs; int tt; bool book[100010]; int main() { string s, s1; getline(cin, s); int flag = 0; for (int i = 0; i < s.size(); i++) { if (s[i] != ' ' &&s[i] != ',' &&s[i] != '.') s1 += s[i], flag = 1; else if (flag == 1) qs.push_back(s1), flag = 0, s1.erase(); } for (int i = 0; i < qs.size(); i++) { flag = 0; string t = qs[i];book[i] = true; for (int j = i + 1; j < qs.size();j++) if (qs[j] == t && !book[j]) { flag = 1; book[j] = true; } if (flag == 1) tt++; } cout << tt << endl; }
- 1
信息
- 难度
- 7
- 分类
- (无)
- 标签
- 递交数
- 169
- 已通过
- 29
- 通过率
- 17%
- 被复制
- 8
- 上传者