Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #unclude<string>
- ....
- class Sentence {
- string str;
- public:
- Sentence(string a):str(a){};
- };
- class InSentence: public Sentence {
- public:
- InSentence(string a):str(a){};
- };
- struct stSentence {
- Sentence _str;
- stSentence* next;
- stSentence():_str(0),next(NULL){};
- stSentence(Sentence* str):_str(str),next(NULL){};
- };
- class Vector {
- stSentence* _stSen;
- int value;
- public:
- void add_stSen(stSentence* stS){
- if(!_stStn) {
- _stStn = stS;
- else {
- stSentence* curr = new stSentence;
- curr = stS;
- curr->next = _stSen;
- _stS = curr;
- };
- value++;
- }
- Vector():_stSen(NULL),value(0);
- Vector(stSenstence* _stS) {
- add_stSen(_stS);
- }
- Vector(string str) {
- _len = strlen(str);
- if(str[_len]='?')
- Sentence* curr = new InSentence(str);
- else
- Sentence* curr = new Sentence(str);
- stSentence*curr = new stSentence;
- add_stSen(curr);
- }
- typedef int* iterator;
- iterator begin() {
- return _stStn;
- }
- iterator end() {
- return _stStn + value + 1;
- }
- };
Add Comment
Please, Sign In to add comment