解题思路:
自动挡
注意事项:
参考代码:
#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语言考试练习题_保留字母 (C语言代码)浏览:575 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:452 |
【亲和数】 (C语言代码)浏览:541 |
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:1428 |
幸运数 (C++代码)浏览:1264 |
Pascal三角 (C语言代码)浏览:652 |
单词个数统计 (C语言代码)浏览:1012 |
C二级辅导-统计字符 (C语言代码)浏览:647 |
C语言程序设计教程(第三版)课后习题11.5 (C语言代码)浏览:999 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:591 |