Changeset 6ac84d8 for app/src/lib
- Timestamp:
- 05/09/08 12:42:32 (17 years ago)
- Branches:
- master, help
- Children:
- 19760ef
- Parents:
- 3748bd1
- git-author:
- obrebski <obrebski@…> (05/09/08 12:42:32)
- git-committer:
- obrebski <obrebski@…> (05/09/08 12:42:32)
- Location:
- app/src/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
app/src/lib/word.cc
rac7d970 r6ac84d8 16 16 lemd[i]='\0'; 17 17 if(isdigit(lemd[0])) 18 fullform(f,lemd,l); // je ¶li lemat zakodowany18 fullform(f,lemd,l); // je¶li lemat zakodowany 19 19 else 20 strcpy(l,lemd); // je ¶li lemat w pe³nej postaci20 strcpy(l,lemd); // je¶li lemat w pe³nej postaci 21 21 strcpy(d,de+i+1); 22 22 } … … 25 25 bool Word::cmp_w(Word a, Word b) { 26 26 return (a.w_suf() > b.w_suf()); 27 } 28 //--------------------------------------------------------------------------- 29 bool Word::cmp_w_rev(Word a, Word b) { 30 return (a.w_suf() < b.w_suf()); 31 } 32 //--------------------------------------------------------------------------- 33 bool cmp_w_fun(Word a, Word b) { 34 return (a.w_suf() > b.w_suf()); 35 } 36 //--------------------------------------------------------------------------- 37 bool cmp_w_rev_fun(Word a, Word b) { 38 return (a.w_suf() < b.w_suf()); 27 39 } 28 40 //--------------------------------------------------------------------------- … … 110 122 void Words::sort() { 111 123 std::sort(tab.begin(), tab.end(), Word::cmp_w); 124 } 125 126 //--------------------------------------------------------------------------- 127 void Words::sort_rev() { 128 std::sort(tab.begin(), tab.end(), cmp_w_rev_fun); 112 129 } 113 130 -
app/src/lib/word.h
rac7d970 r6ac84d8 40 40 public: 41 41 static bool cmp_w(Word a, Word b); 42 static bool cmp_w_rev(Word a, Word b); 42 43 43 44 Word() : _len_suf(-1) { *f='\0'; returned=0; }; … … 104 105 105 106 //--------------------------------------------------------------------------- 107 108 109 110 111 bool cmp_w_fun(Word a, Word b); 112 bool cmp_w_rev_fun(Word a, Word b); 113 114 106 115 //--------------------------------------------------------------------------- 107 116 //--------------------------------------------------------------------------- … … 133 142 134 143 void sort(); 144 void sort_rev(); 135 145 136 146 void prn(ostream& os);
Note: See TracChangeset
for help on using the changeset viewer.