解题思路:
自动挡
注意事项:
参考代码:
#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语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:601 |
C语言程序设计教程(第三版)课后习题10.1 (C语言代码)浏览:1501 |
C语言训练-数字母 (C语言代码)浏览:600 |
C语言程序设计教程(第三版)课后习题5.7 (C++代码)浏览:876 |
C语言程序设计教程(第三版)课后习题9.4 (Java代码)浏览:1440 |
C语言程序设计教程(第三版)课后习题6.10 (C语言代码)浏览:818 |
C语言程序设计教程(第三版)课后习题8.9 (C语言代码)浏览:889 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:909 |
蚂蚁感冒 (C语言代码)浏览:1402 |
【亲和数】 (C语言代码)浏览:625 |