解题思路:
自动挡
注意事项:
参考代码:
#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语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:512 |
C语言程序设计教程(第三版)课后习题7.4 (C语言代码)浏览:606 |
C语言训练-求函数值 (C语言代码)浏览:580 |
printf基础练习2 (有点不明白)浏览:845 |
C语言训练-大、小写问题 (C语言代码)浏览:614 |
WU-输入输出格式练习 (C++代码)浏览:1082 |
DNA (C语言描述,数据结构)浏览:855 |
简单的a+b (C语言代码)浏览:528 |
【绝对值排序】 (C语言代码)浏览:821 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:542 |