POV-Ray : Newsgroups : povray.general : JPovRay ... offtopic : Re: JPovRay ... offtopic Server Time
10 Aug 2024 23:21:39 EDT (-0400)
  Re: JPovRay ... offtopic  
From: Nieminen Juha
Date: 14 Oct 1999 10:14:07
Message: <3805e52f@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.