哪错了?
查看原帖
哪错了?
332914
happybob楼主2020/11/2 20:42
#include <iostream>
#include <cstdio>
#include <cstring>
#include <set>
using namespace std;

set<string> st;

string s;

char ch;

int main()
{
    while(scanf("%c", &ch) != EOF)
    {
        if(isalpha(ch))
        {
            ch = tolower(ch);
            s += ch;
        }
        else
        {
            st.insert(s);
            s = "";
        }
    }
    for(set<string>::iterator it = st.begin(); it != st.end(); ++it)
    {
        cout << *it << endl;
    }
    return 0;
}
2020/11/2 20:42
加载中...