|
|
Thanks for all reminders. Especially thanks to N. Juha for hints.
... And, I really marvel his never ending love to
iterators,adaptors,allocators and other cool STL stuff ;-) ...
Have a good day
Case
Post a reply to this message
|
|
|
|
Case <p.k### [at] shcvutcz> wrote:
: ... And, I really marvel his never ending love to
: iterators,adaptors,allocators and other cool STL stuff ;-) ...
What's the problem with them? You don't have to use them if you don't want
to. Iterators are handy.
Make this with java:
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main()
{ typedef map<string,unsigned> wlist_t;
wlist_t words;
string word;
while(cin) { cin >> word; words[word]++; }
for(wlist_t::iterator i=words.begin(); i!=words.end(); i++)
cout << i->first << ": " << i->second << endl;
}
(It reads text from standard input and ouputs all the words used in the
text in alphabetical order and the number of times it's used; it does it
very fast regardless of the size of the input)
Of course making it with java would certainly be easier than with C... :)
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|