解题思路:
自动挡
注意事项:
参考代码:
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <set> #include <string> #include <vector> #include <stdio.h> #include <sstream> #include <algorithm> using namespace std; void splitStr(string origStr, char delim, vector<string>& strArr) { stringstream ss(origStr); string temp; while (getline(ss, temp, delim)) strArr.push_back(temp); } int solve(string origStr, set<string>& strList) { stringstream ss(origStr); string temp; while (ss >> temp) strList.insert(temp); return strList.size(); } int main() { string str; getline(cin, str); set<string>* strList = new set<string>; cout << solve(str, *strList) << endl; delete strList; return 0; }
0.0分
0 人评分
母牛的故事 (C语言代码)浏览:1298 |
C语言考试练习题_一元二次方程 (C语言代码)浏览:735 |
C语言训练-大、小写问题 (C语言代码)浏览:2351 |
C语言程序设计教程(第三版)课后习题7.1 (C语言代码)浏览:514 |
C语言程序设计教程(第三版)课后习题6.3 (C++代码)浏览:954 |
C语言程序设计教程(第三版)课后习题6.2 (C语言代码)浏览:536 |
C语言训练-亲密数 (C语言描述,反正怎么都能对)浏览:2163 |
数列排序 (C语言代码)浏览:607 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:567 |
C二级辅导-统计字符 (C语言描述——用函数求解)浏览:1178 |