[ create a new paste ] login | about

Link: http://codepad.org/2t0iqszl    [ raw code | output | fork ]

outoftime - C++, pasted on Dec 20:
#include <iostream>
#include <string>
#include <sstream>
#include <set>

using namespace std;

int main()
{
    set <char> S;
    for (int i = 0; i < 26; ++i)
        S.insert(i+'A');
    for (int i = 0; i < 26; ++i)
        S.insert(i+'a');        
	string s = "hg hghfdg7ty fug7 gfdyg fhdngy g. fd gdfg .fd gdfg .sdg j43 g df5 ggdfg5t54. d";
	multiset <string> ms;
    int posn = 0, posk = 0;
    while (posn < int(s.size()) && posk < int(s.size()))
    {
        if (S.find(s[posk]) != S.end()) ++posk;
        else
        {
			if (posn != posk) ms.insert(s.substr(posn,posk-posn));
            posn = ++posk;
        }
    }
    for (multiset <string> :: iterator it = ms.begin(); it != ms.end(); ++it)
        if (*it != "") cout << *it << endl;
	system("pause");
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
df
fd
fd
fhdngy
fug
g
g
gdfg
gdfg
gfdyg
ggdfg
hg
hghfdg
j
sdg
t
ty

Disallowed system call: SYS_fork


Create a new paste based on this one


Comments: