解题思路:
自动挡
注意事项:
参考代码:
#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语言代码)浏览:956 |
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)浏览:517 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:667 |
C语言程序设计教程(第三版)课后习题11.3 (C语言代码)浏览:564 |
C语言程序设计教程(第三版)课后习题10.2 (C语言代码)浏览:535 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:568 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:712 |
【计算两点间的距离】 (C语言代码)浏览:844 |
【密码】 (C语言代码)浏览:500 |
P1025 (C语言代码)浏览:988 |